I am trying to connect to my linux server using the following:
ssh-keygen -t rsa
I then do:
cat ~/.ssh/id_rsa.pub | ssh myusername@myserver_ip 'cat >> .ssh/authorized_keys'
I then go to my remote server and see that a "authorized_keys" file has been created. However when i try doing, "ssh myusername@myserver_ip", it is still prompting me for a password?
Why???
Verify the ownership and permissions on your
~/.ssh
directory and its contents:You may need to check the sshd_config to ensure that these are enabled:
Once those are set to 'yes' then you will need to restart ssh.
Ok First of all make sure you have this options enabled in your /etc/ssh/sshd_config
Second, in order to copy the key from ServerA(where you generated the key) to ServerB(where you want to log in) use the following command:
If by any chance ServerA doesnt have ssh-copy-id command, in ServerA copy the first line of your key WITHOUT the last 2 characters, then paste it in the ServerB Authorized_Keys file. After that type yourself the missing characters from the line you just copied and the first one from line 2, this will prevent adding a "new line" between the first and second line of the key while pasting it from ServerA to ServerB. Repeat with the 3rd line