Synology 上使用公钥进行 ssh - 不起作用

Synology 上使用公钥进行 ssh - 不起作用

我想我已经把所有事情都做对了。公钥/私钥、文件权限等。

有3台机器:

  • Ubuntu
  • old_synology
  • new_synology
  1. 我从 ubuntu 启动,无需密码即可通过 ssh 连接到 old_synology。成功了。
  2. 我无需密码即可从 old_synology ssh 到 new_synology。成功了。
  3. 我尝试从 ubuntu ssh 到 new_synology - 但失败了。
Connection from ubuntu port 41568 on new_synology port 1234
debug1: Client protocol version 2.0; client software version OpenSSH_7.6p1 Ubuntu-4ubuntu0.3
debug1: match: OpenSSH_7.6p1 Ubuntu-4ubuntu0.3 pat OpenSSH* compat 0x04000000
debug1: Local version string SSH-2.0-OpenSSH_7.4
debug1: Enabling compatibility mode for protocol 2.0
debug1: permanently_set_uid: 1024/100 [preauth]
debug1: ssh_sandbox_child: prctl(PR_SET_SECCOMP): Invalid argument [preauth]
debug1: list_hostkey_types: ssh-rsa,rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ssh-ed25519 [preauth]
debug1: SSH2_MSG_KEXINIT sent [preauth]
debug1: SSH2_MSG_KEXINIT received [preauth]
debug1: kex: algorithm: curve25519-sha256 [preauth]
debug1: kex: host key algorithm: ecdsa-sha2-nistp256 [preauth]
debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none [preauth]
debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none [preauth]
debug1: expecting SSH2_MSG_KEX_ECDH_INIT [preauth]
debug1: rekey after 134217728 blocks [preauth]
debug1: SSH2_MSG_NEWKEYS sent [preauth]
debug1: expecting SSH2_MSG_NEWKEYS [preauth]
debug1: SSH2_MSG_NEWKEYS received [preauth]
debug1: rekey after 134217728 blocks [preauth]
debug1: KEX done [preauth]
debug1: userauth-request for user admin service ssh-connection method none [preauth]
debug1: attempt 0 failures 0 [preauth]
debug1: get user realname admin => admin
debug1: user admin matched 'User admin' at line 124
debug1: PAM: initializing for "admin"
debug1: PAM: setting PAM_RHOST to "ubuntu"
debug1: PAM: setting PAM_TTY to "ssh"
debug1: userauth-request for user admin service ssh-connection method publickey [preauth]
debug1: attempt 1 failures 0 [preauth]
debug1: userauth_pubkey: test whether pkalg/pkblob are acceptable for RSA SHA256:*** [preauth]
debug1: temporarily_use_uid: 1024/100 (e=0/0)
debug1: trying public key file /var/services/homes/admin/.ssh/authorized_keys
debug1: fd 4 clearing O_NONBLOCK
debug1: restore_uid: 0/0
Failed publickey for admin from ubuntu port 41568 ssh2: RSA SHA256:***

明显的检查:

  • ubuntu 的公钥/私钥有效,因为我可以登录 old_synology
  • new_synology 的 .ssh/* 文件权限正确,因为我可以从 old_synology 登录
  • ubuntu 的公钥在两个 synology 的 authorized_keys 文件中是相同的。

有任何想法吗?

相关内容