2016-04-12 176 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。我希望它可以在幾天內拯救別人!