我尝试通过ssh从3台机器A,B和C登录服务器.A来自我家,B和C来自学校网络。我可以从A和B登录ssh服务器,但不能从C登录。在主机C上,我得到了这个:
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'mynet.com' is known and matches the RSA host key.
debug1: Found key in /home/myname/.ssh/known_hosts:1
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Trying private key: /home/myname/.ssh/id_rsa
debug1: Trying private key: /home/myname/.ssh/id_dsa
debug1: Next authentication method: password
ssh_userA@mynet.com's password:
debug1: Authentications that can continue: publickey,password
Permission denied, please try again.
ssh_userA@mynet.com's password:
我在ssh服务器上完成了以下操作。
我已将/etc/hosts.allow和/etc/hosts.deny更改为另一个临时名称并执行/etc/init.d/ssh reload
我已经完成iptables -F来清理所有防火墙规则,并使用iptables -L来验证它是否全部打开。
我确信ssh_userA的密码是正确的,因为我可以使用它从A和B登录。我还尝试添加一个新用户ssh_userB。问题仍然存在,只有主机C给我一个权限被拒绝的问题。但是,从主机C我可以成功登录到另一个ssh服务器。
主机A和C是debian,B是centOS。
答案 0 :(得分:0)
答案 1 :(得分:0)
检查/ etc / ssh / sshd_config(Centos)中的AllowUsers指令,这可以设置用户@ ip级别进行SSH访问。