首页 技术 正文
技术 2022年11月17日
0 收藏 593 点赞 2,910 浏览 575 个字

转载请注明出处:

https://www.cnblogs.com/darkknightzh/p/11086935.html

最近使用ubuntu通过ssh连接服务器时,由于密码错误,多次连接失败后,在使用正确的密码时,会出现ssh_exchange_identification: read: Connection reset by peer。

(原)Ubuntu连接远程服务器时connection reset by peer

有多种原因及解决方法,其中一种原因是,多次输入密码错误后,被服务器封了IP。。。(此处使用电脑A,无法登陆服务器,但是使用其他电脑B,就可以成功登陆。)

若是被封了IP,解决方法如下(其他方法m未遇到,因而只针对此方法):

1. 使用电脑B通过ssh登陆服务器,然后通过sudo vi /etc/hosts.deny打开封锁IP的文件:

(原)Ubuntu连接远程服务器时connection reset by peer

打开后,如下(下图已经注释了该文件):

(原)Ubuntu连接远程服务器时connection reset by peer

2. 通过sudo vi /etc/sshd.deny.hosteye打开该文件:

(原)Ubuntu连接远程服务器时connection reset by peer

里面有封了的具体IP,如下:

(原)Ubuntu连接远程服务器时connection reset by peer

3. 在电脑A上使用curl ifconfig.me得到本电脑的公网IP,如下:

(原)Ubuntu连接远程服务器时connection reset by peer

发现和/etc/sshd.deny.hosteye里面的IP一样,证明电脑A确实被封锁了IP。

4. 将/etc/sshd.deny.hosteye里面的IP信息注释掉(我同时也注释了/etc/hosts.deny里面的文件。。。)。

5. 使用电脑A重新登录服务器,可以登录成功了。

(原)Ubuntu连接远程服务器时connection reset by peer

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,117
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,589
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,435
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,206
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,842
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,927