Ren*_*enu 9 ibm-datapower ssh-keys
我曾尝试在 AIX 到 AIX 之间设置公钥连接,并且正在运行,但我在 AIX 和 DataPower 设备之间设置相同的公钥连接时遇到了问题。
我可以在已建立连接的日志中看到,但在使用 public 时,我无法登录,并且每次都希望手动输入密码。
有人可以帮忙吗?
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: ./***_rsa.pub
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,password
debug2: we did not send a packet, disable method
debug3: authmethod_lookup password
debug3: remaining preferred: ,password
Run Code Online (Sandbox Code Playgroud)
Tri*_*und 18
客户端调试()显示的原因有很多很多ssh -vvv ...:
debug2: we did not send a packet, disable method\nRun Code Online (Sandbox Code Playgroud)\n\n其中许多都列在SSH public key won't send to server on Unix & Linux的答案中,但不幸的是,客户端没有给出任何适用的指示。
\n\n当我为此苦苦挣扎时,我的主要问题是显示服务器端日志记录/调试。以下(转述的)建议来自Ciro Santilli \xe5\x86\xa0\xe7\x8a\xb6\xe7\x97\x85\xe6\xaf\x92\xe5\xae\xa1\xe6\x9f\xa5 \xe5\x85\xad\xe5\x9b\x9b\xe4\xba\x8b\xe4\xbb\xb6\xe6\xb3\x95\xe8\xbd\xae\xe5\x8a\x9f \对如何检查的答案sshd 日志?关于服务器故障:
\n\n\n\n在调试模式下在新端口上启动新的 SSH 服务器实例:
\n\nRun Code Online (Sandbox Code Playgroud)\n\n/usr/sbin/sshd -d -p 2222\n然后从客户端连接到它:
\n\nRun Code Online (Sandbox Code Playgroud)\nssh -p 2222 user@host\n
小智 13
如果您对目标服务器有 sudo 访问权限,请检查 SSH 日志 (/var/log/secure),它可能会给您一些线索。就我而言,这是对主目录的错误许可。
chmod g-w /home/user
chmod 700 /home/user/.ssh
chmod 600 /home/user/.ssh/authorized_keys
Run Code Online (Sandbox Code Playgroud)
参考:https ://chemicloud.com/kb/article/ssh-authentication-refused-bad-ownership-or-modes-for-directory/
小智 7
我这样解决了同样的问题
(当我检查系统时.ssh/authorized_keys:文件名错误)
:
cp -p .ssh/authorised_keys .ssh/authorized_keys
Run Code Online (Sandbox Code Playgroud)
请参阅此答案SSH public key won't send to server。
在你的日志中
提供RSA公钥:./***_rsa.pub
...
我们没有发送数据包,禁用方法
这意味着客户端没有发送密钥文件。因此请确保密钥文件存在。
~/.ssh/authorized_keys远程服务器中。小智 5
检查远程服务器上的 ssh 配置,以查找远程系统是否接受正在传递的密钥类型。
检查文件/etc/ssh/sshd_config并查找属性PubkeyAcceptedKeyTypes以确认它接受传递的密钥类型。例如,这里的密钥类型似乎是ssh-rsa,因此应该将其添加到列表中PubkeyAcceptedKeyTypes
(或为了最大兼容性PubkeyAcceptedKeyTypes *)
添加后,重新启动 sshd 守护进程
前任:
sudo sed -i "/.*PubkeyAcceptedKeyTypes.*/d" /etc/ssh/sshd_config
sudo sed -i "/.*RSAAuthentication.*/d" /etc/ssh/sshd_config
sudo sed -i "/.*PubkeyAuthentication.*/d" /etc/ssh/sshd_config
sudo sed -i "/.*PasswordAuthentication.*/d" /etc/ssh/sshd_config
sudo sed -i "/.*PermitRootLogin.*/d" /etc/ssh/sshd_config
echo "PubkeyAcceptedKeyTypes *" | sudo tee -a /etc/ssh/sshd_config
echo "RSAAuthentication yes" | sudo tee -a /etc/ssh/sshd_config
echo "PubkeyAuthentication yes" | sudo tee -a /etc/ssh/sshd_config
echo "PasswordAuthentication no" | sudo tee -a /etc/ssh/sshd_config
echo "PermitRootLogin no" | sudo tee -a /etc/ssh/sshd_config
sudo systemctl restart sshd.service
sudo systemctl status sshd.service | grep -i success
Run Code Online (Sandbox Code Playgroud)