
所有伺服器僅在我的環境中支援 ssh 公鑰身份驗證。當我閱讀 ssh 偵錯資訊時,我注意到「提供 RSA 公鑰」是不同的。
當我從 host1 ssh server1 時
user@host1:~$ ssh -v server1
...
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/user/.ssh/online.pem
debug1: Authentications that can continue: publickey
debug1: Offering RSA public key: /home/user/.ssh/id_rsa
但是,當我從 host2 ssh 到 server2 時
user@host2:$ ssh -v server2
...
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: jumpbox <-- even not a file
哪個 ssh/sshd 設定項會影響 RSA 公鑰提供方法?不幸的是,server1和server2位於隔離網路中,因此我無法從host1 ssh server2 或從host2 ssh server1 來消除某些因素。
答案1
那應該是~/.ssh/config
您機器上的文件。它應該包含 server2 的部分以及身分檔案的選項。