Register for the iXsystems Community to get an ad-free experience and exclusive discounts in our eBay Store.

Unable to use SSH keys to login

What should I do

  • go office space on the servers

    Votes: 0 0.0%

  • Total voters
    7
Status
Not open for further replies.
Joined
Oct 6, 2013
Messages
3
Hello everyone, longtime FreeNAS user, first time poster. This forum has been invaluable as a guest to help me setup my fileserver.

Here is my setup
castor: 192.168.123.23 HP n40L microserver running FreeNAS 9.1.1 x64
pollux: 192.168.123.24 HP n40L microserver running FreeNAS 91.1. x64
Both have 5x 3TB hard drives in them for a total of 10.7TB of usable space in a ZFS Volume (/mnt/media)
Both have users named "vasisht" setup and the home directory for "vasisht" is /mnt/media on both boxes.

I've had castor up and running for about a year now with no problems. /mnt/media is shared via AFP to my mac mini server and macbook pro without any problems and i've been able to read/write data to it without problems. I bought pollux to serve as a backup to castor and it's also configured the same way. I intended to setup a zfs snapshot & replication task but we'll get to that later. I had insane trouble with that and it plain just didn't work.

But now to my question: I've been able to ssh into castor and pollux using password authentication just fine. I've also ssh'd into my mac mini server from my laptop just fine. So I used scp to copy ~/.ssh/id_rsa.pub from my laptop into both castor and pollux (as I've done for years on other systems) and renamed the file authorized_keys. However, neither server will let me log in. I've attached the output of ssh -vvv at the end of this post.

I've now tried changing permissions to .ssh on castor and pollux to no avail (even 777 on both .ssh and authorized_keys) does nothing. I also deleted authorized_keys and went into the web GUI and pasted the contents of id_rsa.pub into the "edit user" page where it says to put in the user's public ssh key and the same problem still happens.

I'm sure there's a step that I've overlooked or forgotten to check a box somewhere but any help would be appreciated.

Thank you all so much.

Output of ssh -vvv while logging into castor
Macbook-Pro:~ vasisht$ ssh -vvv vasisht@castor
OpenSSH_5.9p1, OpenSSL 0.9.8y 5 Feb 2013
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to castor [192.168.123.23] port 22.
debug1: Connection established.
debug3: Incorrect RSA1 identifier
debug3: Could not load "/Users/vasisht/.ssh/id_rsa" as a RSA1 public key
debug1: identity file /Users/vasisht/.ssh/id_rsa type 1
debug1: identity file /Users/vasisht/.ssh/id_rsa-cert type -1
debug1: identity file /Users/vasisht/.ssh/id_dsa type -1
debug1: identity file /Users/vasisht/.ssh/id_dsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.2_hpn13v11 FreeBSD-20130515
debug1: match: OpenSSH_6.2_hpn13v11 FreeBSD-20130515 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.9
debug2: fd 3 setting O_NONBLOCK
debug3: load_hostkeys: loading entries for host "castor" from file "/Users/vasisht/.ssh/known_hosts"
debug3: load_hostkeys: found key type RSA in file /Users/vasisht/.ssh/known_hosts:11
debug3: load_hostkeys: loaded 1 keys
debug3: order_hostkeyalgs: prefer hostkeyalgs: ssh-rsa-cert-v01@openssh.com,ssh-rsa-cert-v00@openssh.com,ssh-rsa
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa-cert-v01@openssh.com,ssh-rsa-cert-v00@openssh.com,ssh-rsa,ssh-dss-cert-v01@openssh.com,ssh-dss-cert-v00@openssh.com,ssh-dss
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: kex_parse_kexinit: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-gcm@openssh.com,aes256-gcm@openssh.com,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-gcm@openssh.com,aes256-gcm@openssh.com,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: hmac-md5-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-sha1,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-md5,hmac-sha1,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none
debug2: kex_parse_kexinit: none
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: mac_setup: found hmac-md5
debug1: kex: server->client aes128-ctr hmac-md5 none
debug2: mac_setup: found hmac-md5
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
debug2: dh_gen_key: priv key bits set: 113/256
debug2: bits set: 528/1024
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Server host key: RSA 92:af:86:a6:98:0a:70:88:fa:68:3f:47:00:1d:f0:30
debug3: load_hostkeys: loading entries for host "castor" from file "/Users/vasisht/.ssh/known_hosts"
debug3: load_hostkeys: found key type RSA in file /Users/vasisht/.ssh/known_hosts:11
debug3: load_hostkeys: loaded 1 keys
debug3: load_hostkeys: loading entries for host "192.168.123.23" from file "/Users/vasisht/.ssh/known_hosts"
debug3: load_hostkeys: found key type RSA in file /Users/vasisht/.ssh/known_hosts:11
debug3: load_hostkeys: loaded 1 keys
debug1: Host 'castor' is known and matches the RSA host key.
debug1: Found key in /Users/vasisht/.ssh/known_hosts:11
debug2: bits set: 515/1024
debug1: ssh_rsa_verify: signature correct
debug2: kex_derive_keys
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /Users/vasisht/.ssh/id_rsa (0x7fe8bb41d200)
debug2: key: /Users/vasisht/.ssh/id_dsa (0x0)
debug1: Authentications that can continue: publickey,password
debug3: start over, passed a different list publickey,password
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 RSA public key: /Users/vasisht/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /Users/vasisht/.ssh/id_dsa
debug3: no such identity: /Users/vasisht/.ssh/id_dsa
debug2: we did not send a packet, disable method
debug3: authmethod_lookup password
debug3: remaining preferred: ,password
debug3: authmethod_is_enabled password
debug1: Next authentication method: password
vasisht@castor's password:
 

Dusan

Guru
Joined
Jan 29, 2013
Messages
1,165
I've now tried changing permissions to .ssh on castor and pollux to no avail (even 777 on both .ssh and authorized_keys) does nothing.
OpenSSH will actually actively refuse to use a 777 authorized_keys file. If will also not use it if the $HOME and $HOME/.ssh directories' permissions are too permissive, or if the authorized_keys file is not owned by the correct user. See: http://www.openssh.org/faq.html#3.14
Also check /var/log/auth.log on the destination machine for any signs of a problem.
 

paleoN

Wizard
Joined
Apr 22, 2012
Messages
1,403
... delete ...
 
Status
Not open for further replies.
Top