ssh public key authentication works via CLI but not for Webgui (Replication Task)

peacepipe

Dabbler
Joined
Dec 17, 2017
Messages
36
Hi everyone,

I have trouble with the ssh connection from FreeNAS to my virtual private server but only from the Webgui as replication task. I don't get it why it doesn't work. Here is the log output if I connect via replication task from FreeNAS to the VPS:
Dec 17 13:21:20 vmd13608 sshd[1245712]: debug2: check_authkeys_file: /home/user/.ssh/authorized_keys: processed 3/3 lines
Dec 17 13:21:20 vmd13608 sshd[1245712]: debug1: restore_uid: 0/0
Dec 17 13:21:20 vmd13608 sshd[1245712]: debug3: mm_answer_keyallowed: publickey authentication: RSA key is not allowed
Dec 17 13:21:20 vmd13608 sshd[1245712]: Failed publickey for user from 77.64.88.66 port 13768 ssh2: RSA SHA256:iWkZhH6fI9g/5C1aXtQPyVqQCUrhVWYZt07kaRVjhU4
Dec 17 13:21:20 vmd13608 sshd[1245712]: debug3: mm_request_send: entering, type 23
Dec 17 13:21:20 vmd13608 sshd[1245712]: debug2: userauth_pubkey: authenticated 0 pkalg rsa-sha2-512 [preauth]
Dec 17 13:21:20 vmd13608 sshd[1245712]: debug3: user_specific_delay: user specific delay 0.000ms [preauth]
Dec 17 13:21:20 vmd13608 sshd[1245712]: debug3: ensure_minimum_time_since: elapsed 7.576ms, delaying 5.838ms (requested 6.707ms) [preauth]
Dec 17 13:21:20 vmd13608 sshd[1245712]: debug3: userauth_finish: failure partial=0 next methods="publickey,password" [preauth]
Dec 17 13:21:20 vmd13608 sshd[1245712]: debug3: send packet: type 51 [preauth]

On the other hand if I connect directly from the CLI via ssh to the VPS it's working:
Dec 17 13:19:25 vmd13608 sshd[1244706]: debug1: temporarily_use_uid: 1001/1001 (e=0/0)
Dec 17 13:19:25 vmd13608 sshd[1244706]: debug1: trying public key file /home/user/.ssh/authorized_keys
Dec 17 13:19:25 vmd13608 sshd[1244706]: debug1: fd 5 clearing O_NONBLOCK
Dec 17 13:19:25 vmd13608 sshd[1244706]: debug1: /home/user/.ssh/authorized_keys:2: matching key found: RSA SHA256:UNwc5eNwQN/NdDQ28K4NQ1BW5IqyN4azl9vqfrxIssU
Dec 17 13:19:25 vmd13608 sshd[1244706]: debug1: /home/user/.ssh/authorized_keys:2: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
Dec 17 13:19:25 vmd13608 sshd[1244706]: Accepted key RSA SHA256:UNwc5eNwQN/NdDQ28K4NQ1BW5IqyN4azl9vqfrxIssU found at /home/user/.ssh/authorized_keys:2
Dec 17 13:19:25 vmd13608 sshd[1244706]: debug2: check_authkeys_file: /home/user/.ssh/authorized_keys: processed 2/3 lines
Dec 17 13:19:25 vmd13608 sshd[1244706]: debug1: restore_uid: 0/0
Dec 17 13:19:25 vmd13608 sshd[1244706]: debug3: mm_answer_keyallowed: publickey authentication: RSA key is allowed
Dec 17 13:19:25 vmd13608 sshd[1244706]: debug3: mm_request_send: entering, type 23

So as you can see it's using different keys.
The fingerprint "iWkZhH6fI9g/5C1aXtQPyVqQCUrhVWYZt07kaRVjhU4" is from the pub key from my VPS user.
checked with:

ssh-keygen -lf id_rsa.pub
3072 SHA256:iWkZhH6fI9g/5C1aXtQPyVqQCUrhVWYZt07kaRVjhU4 "

The fingerprint "UNwc5eNwQN/NdDQ28K4NQ1BW5IqyN4azl9vqfrxIssU" is from my FreeNAS Server.

What am I missing?


Thanks everyone!
 
Top