I have the following command:
ssh -o StrictHostKeyChecking=no [email protected]... "cd /var/www/api && git pull origin master"
I want to access it (named “destination server”) without asking for password (because I want to use it in gitlab-ci)
What I’ve done:
- I generated a ssh public/private keys by this command on the destination server:
ssh-keygen -t rsa -b 2048
- I put the public key inside
~/.ssh/authorized_keys
on the destination server - I put the private key on my local computer
But still when I run the ssh
command to access the destination server by my local computer, it asks for password. Any idea how can I debug it?