Python 官方文档:入门教程 => 点击学习
使用多进程启动多个ssh报错: Exception (client): Error reading SSH protocol banner[Errno 104] Connection reset by peerDuring handlin
使用多进程启动多个ssh报错:
Exception (client): Error reading SSH protocol banner[Errno 104] Connection reset by peerDuring handling of the above exception, another exception occurred:Traceback (most recent call last): File "/root/anaconda3/envs/python38/lib/python3.8/site-packages/paramiko/transport.py", line 2091, in run self._check_banner() File "/root/anaconda3/envs/Python38/lib/python3.8/site-packages/paramiko/transport.py", line 2272, in _check_banner raise SSHException(Traceback (most recent call last):paramiko.ssh_exception.SSHException: Error reading SSH protocol banner[Errno 104] Connection reset by peer File "/root/anaconda3/envs/Python38/lib/python3.8/site-packages/paramiko/transport.py", line 2268, in _check_banner buf = self.packetizer.readline(timeout) File "/root/anaconda3/envs/Python38/lib/python3.8/site-packages/paramiko/packet.py", line 374, in readline buf += self._read_timeout(timeout) File "/root/anaconda3/envs/Python38/lib/python3.8/site-packages/paramiko/packet.py", line 601, in _read_timeout x = self.__Socket.recv(128)ConnectionResetError: [Errno 104] Connection reset by peer
其中一种可能原因是目标linux系统的ssh连接数有限制,可尝试修改ssh连接数后重启ssh:
vim /etc/ssh/sshd_config
MaxStartups参数可以设置最大未认证连接数。默认设置是 10:30:100,意思是从第10个连接开始以30%的概率拒绝新连接,直到连接数达到100为止。
# ubuntu系统/etc/init.d/ssh restart# Centos系统service sshd restart
来源地址:https://blog.csdn.net/zywhehe/article/details/129012408
--结束END--
本文标题: Python 报错处理 paramiko.ssh_exception.SSHException: Error reading SSH protocol banner
本文链接: https://lsjlt.com/news/396832.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-03-01
2024-03-01
2024-03-01
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0