View Single Post
  #1   (View Single Post)  
Old 11th November 2011
amrogers3 amrogers3 is offline
Port Guard
 
Join Date: Oct 2011
Posts: 20
Default Using public keys for SSH authentication

Got a question regarding authentication using public key on openBSD 4.9. SSHd is on BSD and I am using a MAC OSX 5.4 to access SSHd server.

So I created a 2048 bit RSA key using ssh-keygen. I placed the .pub key on the openBSD SSHD server by using
Code:
scp ~/.ssh/id_rsa.pub root@192.168.3.2:
I know, I know using root is terrible.

I ran chmod 600 on id_rsa.pub and moved .pub file on BSD box(I now realize I should have ran chmod 600 after moving file)
Code:
mv /id_rsa.pub /etc/.ssh/authorized_keys
I then modified the /etc/sshd_config on BSD box by removing the "#" and changing "yes" to "no"
Code:
#PasswordAuthentication yes (removed this line)
PasswordAuthentication no (added this line)
Already enabled, no changes made for publickey:
Code:
#publickeyauthentication yes
sshd_config files says to leave "#" on each line unless you change the default value. Only value I changed was PasswordAuthentication from yes to no.

Was able to log in using password before but now can't seem to log in. I did a good amount of research to get this far but now I am stuck. Any ideas what may be preventing me from logging in?

Error is:
Code:
user$ssh root@192.168.3.2
Permission denied (publickey,keyboard-interactive).

Last edited by amrogers3; 11th November 2011 at 05:02 PM. Reason: corrected ssh-keygen
Reply With Quote