¿How to clone remote Git repository from my laptop using ssh access?

Hi! :smile:
I have a VPS server contracted with Hostinger. I have installed Debian 11 along with HestiaCP. I have managed to configure new users, add SSL to domains and the Hestia panel, emails, etc., without any issues. Now I want to be able to edit my web files in the “html_public” folders from my laptop remotely. Since Hostinger already gave me SSH access to root, I thought about adding SSH to the user (with the ‘user’ role in Hestia) that I specifically use to manage the domains, with the aim of performing a ‘git init’ from the “public_html” folder. I have managed to do all of this, but the problem arises when I try to perform a ‘git clone’ from my laptop with the following command: ‘git clone [email protected]:usuarioHestia/midominio.com/public_html.git’ The server responds with: ''Cloning into ‘public_html’…
[email protected]’s password:" I have not known how to respond to this, and I have tried with all the passwords I have noted down (the passwords of the Hestia users, the root Admin, the SSH key passwords) and nothing. I must also clarify that from the Hestia panel, I have added an SSH key to the user with which I want to log in, and still nothing: “Permission denied, please try again.”

Hi @onsweb do you have a remote server? Because normally you push the code to a platform like Github of Gitlab in e repository. Or maybe you have your own git server?

Maybe the easiest way to upload your files, is to use Filezilla to setup a file transfer over SSH?

Otherwise maybe you want to use a local git repo as a remote git repo but I have never heard of this but I see that it should be possible some how:

1 Like

Hello! I’ve managed to achieve what I wanted. The server I have has Git installed on its operating system. I access the server using SSH authentication, and from there, I initialized Git in the html_public folder with ‘git init’; then, in a folder on my computer, I cloned the repository I created with ‘git clone [email protected]:/directorio/del/servidor/al/repositorio/.git’. Now I can make changes from my computer and commit them. So, I don’t need Gitlab for now.

1 Like