SSH并行命令执行冻结 [英] SSH parallel command execution freeze

查看:501
本文介绍了SSH并行命令执行冻结的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图多次执行从一台计算机/ IP以下code

 #!/斌/庆典
因为我在'序列1 10`;
    做
        SSH 11.156.112.111 PWD
    DONE#我知道剧本是没用的,它只是为了演示。

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

我CONFIGS

 #的.ssh /配置
主机*
    ServerAliveInterval 10
    ServerAliveCountMax 10#sshd_config中
    UsePAM无
    MAXSESSIONS 100
    MaxStartups 100

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

  OpenSSH_7.2p2,OpenSSL的1.0.2f 2016年1月28日
DEBUG1:读取配置数据/home/neelix/.ssh/config
DEBUG1:/home/neelix/.ssh/config线1:应用选项*
DEBUG1:/home/neelix/.ssh/config第11行:为11.156.112.111应用方案
DEBUG1:读取配置数据的/ etc / SSH / ssh_config中
DEBUG2:解决11.156.112.111端口22
DEBUG2:ssh_connect_direct:needpriv 0
DEBUG1:连接到11.156.112.111 [11.156.112.111]端口22。
DEBUG1:连接建立。
DEBUG1:标识文件/home/neelix/.ssh/id_rsa 1型
DEBUG1:key_load_public:没有这样的文件或目录
DEBUG1:标识文件/home/neelix/.ssh/id_rsa-cert类型-1
DEBUG1:启用兼容模式协议2.0
DEBUG1:本地版本字符串SSH-2.0-OpenSSH_7.2


解决方案

我的托管服务提供商很多支持票后,我发现他们有IDS(入侵检测系统),它检测到我的人谁是做了蛮力在端口22和改变我的端口攻击解决了这一问题。

有关未来的读者上面的意见是非常有助于缩小问题,特别是回答这个<一个href=\"http://unix.stackexchange.com/questions/151860/ssh-exchange-identification-read-connection-reset-by-peer\">question.我希望这样可以节省别人一两天!

I am trying to execute following code multiple times from one machine/ip

#!/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. 

I can't execute the script in more than two terminal at the same time, when I try to run the script in the third terminal, it freezes and I can't login but I can login from another machine/ip.

my configs

# .ssh/config
Host *
    ServerAliveInterval 10
    ServerAliveCountMax 10

# sshd_config
    UsePAM no
    MaxSessions 100
    MaxStartups 100

Here is the output of verbose mode, it freezes on the last line:

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

解决方案

After many support tickets with my hosting provider, I found out that they had IDS(Intrusion Detection System) and it detected me as someone who is doing a brute force attack on port 22 and changing my port fixed the problem.

For future readers the comments above are quite helpful to narrow down the problem, specially answers to this question. I hope it saves someone else a couple of days!

这篇关于SSH并行命令执行冻结的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆