2016-04-12 174 views
1

我试图执行从一台机器下面的代码多次/ IPSSH并行命令执行冻结

#!/bin/bash 
for i in `seq 1 10`; 
    do 
     ssh 11.156.112.111 pwd 
    done  

# I know that the script is useless, it's just for demonstration. 

我不能同时在两个以上的终端执行脚本,当我尝试在第三个终端运行该脚本,它冻结,我无法登录,但我可以从另一台机器/ IP登录。

我CONFIGS

# .ssh/config 
Host * 
    ServerAliveInterval 10 
    ServerAliveCountMax 10 

# sshd_config 
    UsePAM no 
    MaxSessions 100 
    MaxStartups 100 

下面是详细模式输出,它冻结在最后一行:

OpenSSH_7.2p2, OpenSSL 1.0.2f 28 Jan 2016 
debug1: Reading configuration data /home/neelix/.ssh/config 
debug1: /home/neelix/.ssh/config line 1: Applying options for * 
debug1: /home/neelix/.ssh/config line 11: Applying options for 11.156.112.111 
debug1: Reading configuration data /etc/ssh/ssh_config 
debug2: resolving "11.156.112.111" port 22 
debug2: ssh_connect_direct: needpriv 0 
debug1: Connecting to 11.156.112.111 [11.156.112.111] port 22. 
debug1: Connection established. 
debug1: identity file /home/neelix/.ssh/id_rsa type 1 
debug1: key_load_public: No such file or directory 
debug1: identity file /home/neelix/.ssh/id_rsa-cert type -1 
debug1: Enabling compatibility mode for protocol 2.0 
debug1: Local version string SSH-2.0-OpenSSH_7.2 
+0

试着运行'ssh -v 11.156.112.111 pwd'来抓住ssh卡住的地方 – Samuel

+0

我已经更新了这个问题。 – neelix

+0

你在你的问题中提到的脚本是否是卡住的确切脚本? – Samuel

回答

0

与我的托管服务提供商很多支持票后,我发现他们有IDS(入侵检测系统),它检测到我是对22端口进行暴力攻击的人,并且改变我的端口来解决问题。

对于未来的读者,上述评论对缩小问题非常有帮助,特别回答了这个question。我希望它可以在几天内拯救别人!