Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Distribution: Mac OS X Leopard 10.6.2, Windows 2003 Server/Vista/7/XP/2000/NT/98, Ubuntux64, CentOS4.8/5.4
Posts: 2,986
Rep:
SSH - trouble authenticating private/public key
I can't figure this out on my Ubuntu system as I have successfully done this on SuSE 10.2, but I created a private/public key and sent the public key to the remote computer. When I try to SSH in, it still asks me for my password.
1) I did rename id_rsa.pub to authorized_keys on the remote computer
2) I did make sure that
You shouldn't need the RSAAuthentication entry since it defaults to yes and only applies to protocol version 1 anyway. Can you try to connect with the following command line (change the username and host to your values)?
I get the same "missing whitespace" stuff here - it doesn't seem to cause any problems. My output is similar to yours up to the end. Where you have debug3: input_userauth_banner I have the following:
Code:
debug1: Authentications that can continue: publickey,keyboard-interactive
debug3: start over, passed a different list publickey,keyboard-interactive
debug3: preferred publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /home/steve/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Server accepts key: pkalg ssh-rsa blen 149
debug2: input_userauth_pk_ok: fp xx:a8:9b:c8:75:ae:d1:7e:56:e8:1e:65:fc:xx:xx:xx
debug3: sign_and_send_pubkey
debug1: PEM_read_PrivateKey failed
debug1: read PEM private key done: type <unknown>
Enter passphrase for key '/home/steve/.ssh/id_rsa':
If it helps, the only entries in my /etc/ssh/sshd_config that aren't commented (ie are at default settings) are:
Code:
Port 22
Protocol 2
AllowUsers steve
PermitRootLogin no
PasswordAuthentication no
X11Forwarding yes
Subsystem sftp /usr/libexec/sftp-server
Also, here are my client config files permissions:
Code:
$ ls -ld .ssh
drwx------ 2 steve steve 4096 2006-10-08 21:52 .ssh/
$ ls -Al .ssh
total 16
lrwxrwxrwx 1 steve steve 10 2006-10-08 12:55 authorized_keys -> id_rsa.pub
-rw------- 1 steve steve 951 2006-01-05 02:23 id_rsa
-rw-r----- 1 steve steve 244 2006-01-05 02:23 id_rsa.pub
-rw-r----- 1 steve steve 643 2006-11-08 11:12 known_hosts
Distribution: Mac OS X Leopard 10.6.2, Windows 2003 Server/Vista/7/XP/2000/NT/98, Ubuntux64, CentOS4.8/5.4
Posts: 2,986
Original Poster
Rep:
I went into my /var/log/auth.log and found this:
Code:
Authentication refused: bad ownership or modes for directory /home/ken/.ssh
I changed .ssh permission from 755 on the remote computer to 700 and that solved the trick! I guess it's a security feature. Thanks for posting the file permissions, gilead!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.