Please note the new address for this forum : forum.excito.org. The old address redirects here but I don't know for how long. Thanks !
New user's registration have been closed due to high spamming and low trafic on this forum. Please contact forum admins directly if you need an account. Thanks !

SSH key authentication?

Got problems with your B2 or B3? Share and get helped!
Post Reply
Filius
Posts: 14
Joined: 26 Oct 2009, 02:21

SSH key authentication?

Post 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? :(
Eek
Posts: 372
Joined: 23 Dec 2007, 03:03
Location: the Netherlands

Re: SSH key authentication?

Post by Eek »

could you do a

Code: Select all

find .ssh -ls
cheers
Eek
Filius
Posts: 14
Joined: 26 Oct 2009, 02:21

Re: SSH key authentication?

Post 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.
jonj1
Posts: 51
Joined: 24 Oct 2008, 15:33

Re: SSH key authentication?

Post 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
Filius
Posts: 14
Joined: 26 Oct 2009, 02:21

Re: SSH key authentication?

Post by Filius »

Didnt help :/
Filius
Posts: 14
Joined: 26 Oct 2009, 02:21

Re: SSH key authentication?

Post 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 :)
Post Reply