简体   繁体   English

特定计算机拒绝ssh登录权限

[英]ssh login permission denied from a specific machine

I try to login a server via ssh from 3 machines, A, B and C. A is from my home, B and C are from school network. 我尝试通过SSH从3台计算机A,B和C登录服务器。A来自我的家,B和C来自学校网络。 I can login the ssh server from A and B, but not from C. On host C, I get this: 我可以从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: 

I have done following on the ssh server. 我已经在ssh服务器上完成了以下操作。

I have changed /etc/hosts.allow and /etc/hosts.deny to another temp name and did /etc/init.d/ssh reload 我已经将/etc/hosts.allow和/etc/hosts.deny更改为另一个临时名称,并重新加载了/etc/init.d/ssh

I have done iptables -F to clean up all firewall rules, and did iptables -L to verify it's all open. 我已经完成了iptables -F来清除所有防火墙规则,并且已经完成了iptables -L来验证它是否全部打开。

I am sure the pasword for ssh_userA is correct since I can use it to login from A and B. I also tried to add a new user ssh_userB. 我确定ssh_userA的密码正确,因为我可以使用它从A和B登录。我还尝试添加新用户ssh_userB。 The problem still, only host C gives me a permission denied problem. 问题仍然存在,只有主机C给我一个权限被拒绝的问题。 However, from host CI can successfully login to another ssh server. 但是,从主机CI可以成功登录到另一个ssh服务器。

Host A and C are debian, B is centOS. 主机A和C是debian,B是centOS。

wild guess. 胡乱猜测。 perhaps use internal IP when you are in the same network? 在同一个网络中时也许使用内部IP?

检查/ etc / ssh / sshd_config(Centos)中的AllowUsers指令,这可以为SSH访问设置user @ ip级别。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM