Page 1 of 1
SSH key authentication?
Posted: 27 Nov 2009, 03:28
by Filius
Hi,
Im having a problem with my Bubba II. I cannot get SSH key based login to work. I have copied my clients pubkeys to the bubba, and added them to the ~/.ssh/authorized_keys authorized_keys2 files.
However, when I try to log in it prompts me for a password. I have done this for several other machines, cannot see why it should be different on the bubba?

Re: SSH key authentication?
Posted: 27 Nov 2009, 05:10
by Eek
Re: SSH key authentication?
Posted: 27 Nov 2009, 11:41
by Filius
Code: Select all
stian@butterbub:~$ find .ssh -ls
23838750 4 drwx------ 2 stian users 4096 Nov 27 17:39 .ssh
23838822 0 lrwxrwxrwx 1 stian users 16 Nov 27 17:39 .ssh/authorized_hosts2 -> authorized_hosts
23854495 4 -rw-r--r-- 1 stian users 397 Oct 31 12:18 .ssh/id_rsa.pub
23838752 4 -rw-rw-rw- 1 stian users 420 Oct 28 07:36 .ssh/authorized_hosts
23838751 4 -rw-r--r-- 1 stian users 420 Oct 28 07:35 .ssh/id_rsa_stian_09.pub
23854488 4 -rw------- 1 stian users 1675 Oct 31 12:18 .ssh/id_rsa
23838816 4 -rw-r--r-- 1 stian users 884 Oct 31 10:49 .ssh/known_hosts
Code: Select all
stian@butterbub:~$ diff .ssh/authorized_hosts .ssh/id_rsa_stian_09.pub
stian@butterbub:~$
Obviously my user is stian. The id_rsa_stian_09.pub is from the client machine.
Re: SSH key authentication?
Posted: 27 Nov 2009, 11:58
by jonj1
Try changing the permissions on .ssh/authorized_hosts to restrict READ AND WRITE to your user
eg.
chmod go-rw ~/.ssh/authorized_hosts
SSH doesn't like it when these files are world-readable
Re: SSH key authentication?
Posted: 27 Nov 2009, 15:28
by Filius
Didnt help :/
Re: SSH key authentication?
Posted: 29 Nov 2009, 14:08
by Filius
How utterly embarrassing...
I satt staring at my terminal window just now... just ripping out my hair... WHAT ON EARTH CAN BE WRONG! I HAVE DONE THIS A DOZEN TIMES BEFORE!
Then it just hit me.... authorized_hosts? No... of course... its authorized_keys.. not hosts... so I changed the files and low and behold...
Code: Select all
stian-skarsb-solheims-imac:.ssh stian$ ssh -v xx.xx.xx.xx
OpenSSH_5.2p1, OpenSSL 0.9.8k 25 Mar 2009
debug1: Reading configuration data /Users/stian/.ssh/config
debug1: Applying options for xx.xx.xx.xx
debug1: Reading configuration data /etc/ssh_config
debug1: auto-mux: Trying existing master
debug1: Control socket "/Users/stian/.ssh/stian@xx.xx.xx.xx:22" does not exist
debug1: Connecting to xx.xx.xx.xx [xx.xx.xx.xx] port 22.
debug1: Connection established.
debug1: identity file /Users/stian/.ssh/identity type -1
debug1: identity file /Users/stian/.ssh/id_rsa type -1
debug1: identity file /Users/stian/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_4.3p2 Debian-9etch3ex1
debug1: match: OpenSSH_4.3p2 Debian-9etch3ex1 pat OpenSSH_4*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.2
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'xx.xx.xx.xx' is known and matches the RSA host key.
debug1: Found key in /Users/stian/.ssh/known_hosts:6
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Trying private key: /Users/stian/.ssh/identity
debug1: read PEM private key done: type RSA
debug1: Authentication succeeded (publickey).
debug1: channel 0: new [client-session]
debug1: setting up multiplex master socket
debug1: Entering interactive session.
Last login: Sun Nov 29 20:02:01 2009 from xx.xx.xx.xx
Linux butterbub 2.6.26.5 #3 Thu Aug 6 14:46:56 CEST 2009 ppc
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
stian@butterbub:~$
Thanks anyway
