SSH permission & Git push from local to remote server

January 8, 2018 124 views
Git Ubuntu 16.04

I am trying to setup a git repo on my local than can push to my ubuntu server. I have been following this tutorial . I have also FTPed in to the server to make sure all my files are being edited/created. Under 'Setup a Git User and Install Git on your VPS' step I followed the commands to create a user git. I checked to see if it exists with the command 'compgen -u' . Yep I see git there. When I put in the next step I get the following errors:

git@K-home:/$ mkdir ~/.ssh && touch ~/.ssh/authorized_keys
mkdir: cannot create directory ‘/home/git/.ssh’: No such file or directory

I checked the /home directory and I see another user I created. However, I do not see the git user that I apparently created.

I also tried to copy and paste that user and update the name to git, didnt work since when I try to push from my local to that remote I get this error

mMP$ git push upstream master
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

can you guys help? I am not sure what I am doing wrong here

Be the first one to answer this question.