SOLVED SSH with key into Synology NAS from FreeNAS

Status
Not open for further replies.

Thefarelkid

Cadet
Joined
Oct 29, 2016
Messages
5
I'm trying to follow this tutorial to back up to a Synology NAS from FreeNAS but I cannot get it to accept my SSH key. I can't figure it out and I've done this successfully many times before. Logging in with password works fine, and as the output below shows, the sshconfig is set to allow for keys. What am I missing here?

I'm running FreeNAS 9.10.2-U5 and Synology DSM 6.1.3-15152.

Code:
rsync-backup@freenas:~ % ssh -v -i .ssh/id_rsa rsync@192.168.1.150
OpenSSH_7.4p1, OpenSSL 1.0.1u-freebsd  22 Sep 2016
debug1: Reading configuration data /usr/local/etc/ssh/ssh_config
debug1: Connecting to 192.168.1.150 [192.168.1.150] port 22.
debug1: Connection established.
debug1: identity file .ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file .ssh/id_rsa-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.4-hpn14v5
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.8p1-hpn14v6
debug1: match: OpenSSH_6.8p1-hpn14v6 pat OpenSSH* compat 0x04000000
debug1: Authenticating to 192.168.1.150:22 as 'rsync'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256@libssh.org
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: REQUESTED ENC.NAME is 'chacha20-poly1305@openssh.com'
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: REQUESTED ENC.NAME is 'chacha20-poly1305@openssh.com'
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:5kFRSNTCjoW+LQtxnTvM5DAutgEE2Ix9qK8KV3F2qy0
debug1: skipped DNS lookup for numerical hostname
debug1: Host '192.168.1.150' is known and matches the ECDSA host key.
debug1: Found key in /mnt/Pool2/home/rsync-backup/.ssh/known_hosts:1
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering RSA public key: .ssh/id_rsa
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: password
rsync@192.168.1.150's password:
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Are there any logs you can check on the Synology box? My guesses would be that either you're just using the wrong key, or permissions (on the Synology side) of .ssh or authorized_keys are incorrect.
 

Thefarelkid

Cadet
Joined
Oct 29, 2016
Messages
5
It did turn out to be a permissions issue, but not one you would expect. I guess the users home directory was set with too high permissions. Even though .ssh was 644 and authorized_keys was set to 600, the users home folder needed to be at 755. Only about 4 hours of looking around on the Synology forums to find it. I hope leaving this here helps.
 
Status
Not open for further replies.
Top