公司做网站的费用怎么记账,南通网站制作设计,相亲网站拉人做基金,网站关键词如何做优化文章目录 一、问题问题现象1.1 连接重置无法访问的的问题1.2 查看服务器连接状态1.3 使用调试模式查看的信息 二、临时解决方法三、从根源解决问题3.1 问题分析3.2 服务器的ssh日志3.3 修改ssh配置禁止root登录3.4 配置允许所有ip访问3.5 修改认证方法 角色#xff1a;百世经纶… 文章目录 一、问题问题现象1.1 连接重置无法访问的的问题1.2 查看服务器连接状态1.3 使用调试模式查看的信息 二、临时解决方法三、从根源解决问题3.1 问题分析3.2 服务器的ssh日志3.3 修改ssh配置禁止root登录3.4 配置允许所有ip访问3.5 修改认证方法 角色百世经纶一页书 诗号世事如棋乾坤莫测笑尽英雄啊 佛门高僧苦境正道精神指标及领导者之一亦是灭境三天之一的『梵天』。 与素还真、叶小钗并称霹雳三台柱。 与素还真并列苦境中原武林两大支柱亦称“梵天”。 高深的禅修大般若与武学修为法相庄严、胸怀无私、正气凛然出道以来屡次帮助素还真携手共同弭平武林狼烟、扭转乾坤化解危机。 身为佛门高僧悲悯如一页天书渡化迷航众生但行事作风果决明快、妒恶如仇铲奸除恶绝不手软为正道的精神指标及领导者之一与众不同的百世经纶半阖眼眸看尽世俗庸人微扬嘴角笑尽天下英雄。 一、问题问题现象
1.1 连接重置无法访问的的问题
ssh_exchange_identification: read: Connection reset1.2 查看服务器连接状态 通过查看路由器信息发现服务器已经正常连接上网络。
1.3 使用调试模式查看的信息
PS C:\WINDOWS\system32 ssh -v [IP地址] -p [端口].
OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5
debug1: Reading configuration data C:\\Users\\LJM/.ssh/config
debug1: Connecting to [IP地址] port [端口].
debug1: Connection established.
debug1: identity file C:\\Users\\LJM/.ssh/id_rsa type 0
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\LJM/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\LJM/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\LJM/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\LJM/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\LJM/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\LJM/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\LJM/.ssh/id_ed25519-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\LJM/.ssh/id_xmss type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\LJM/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_for_Windows_7.7
ssh_exchange_identification: read: Connection reset
PS C:\WINDOWS\system32可以看到有连接上ssh服务器但是一直没有找到对应的密钥信息。
二、临时解决方法
我将服务器的插座换成了只能插座这个问题一般临时处理都是直接重启服务器一次不行就两次开个几次就能连接上了。 万能的重启法啊我也很无奈。
三、从根源解决问题
3.1 问题分析
通过调试模式看到的信息显示的是密钥没有找到。 首先有可能是密钥丢失的问题但是服务器一直有在正常使用也都正常访问不应该是密钥文件丢失。 然后开始的时候也有考虑是不是ssh服务没有启动但是设置了开机自己启动了为了安全我每天断电先使用crontab设置了定时关机然后再断电很少有服务不启动了。然后日志显示服务是有启动的。 后面上网搜了下大部分说是因为过多的访问导致服务器拒绝连接了。
3.2 服务器的ssh日志
ubuntuubuntu:~$ sudo cat /var/log/auth.log | grep -a sshd服务器有一些暴力访问的
3.3 修改ssh配置禁止root登录
ubuntuubuntu:~$ sudo vim /etc/ssh/sshd_config # 编辑配置文件修改PermitRootLogin选项为no
PermitRootLogin no # 禁止mroot账户登录这是避免恶意共计对本次问题或许有改善但是还是发生了无法访问的问题。
3.4 配置允许所有ip访问
ubuntuubuntu:~$ sudo cat /etc/hosts.allow # 查看服务允许连接的ip信息
# /etc/hosts.allow: list of hosts that are allowed to access the system.
# See the manual pages hosts_access(5) and hosts_options(5).
#
# Example: ALL: LOCAL some_netgroup
# ALL: .foobar.edu EXCEPT terminalserver.foobar.edu
#
# If youre going to protect the portmapper use the name rpcbind for the
# daemon name. See rpcbind(8) and rpc.mountd(8) for further information.
#ubuntuubuntu:~$ sudo vim /etc/hosts.allow # 通过vim添加 sshd:ALL
ubuntuubuntu:~$ sudo cat /etc/hosts.allow # 再次查看下有添加进去了
# /etc/hosts.allow: list of hosts that are allowed to access the system.
# See the manual pages hosts_access(5) and hosts_options(5).
#
# Example: ALL: LOCAL some_netgroup
# ALL: .foobar.edu EXCEPT terminalserver.foobar.edu
#
# If youre going to protect the portmapper use the name rpcbind for the
# daemon name. See rpcbind(8) and rpc.mountd(8) for further information.
#
sshd:ALL
ubuntuubuntu:~$ systemctl restart sshd # 重启服务如果服务重启不了也可以使用reboot重启服务器。结果 此招我设置之后第2天就还是报一样的问题了无效。
3.5 修改认证方法
万能的重启之后我有链接了这次打印了正常的连接日志重置的是在找密钥的问题。
debug1: identity file C:\\Users\\LJM/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_for_Windows_7.7
# 就是在这一步卡死然后重置连接的。
debug1: Remote protocol version 2.0, remote software version OpenSSH_8.9p1 Ubuntu-3ubuntu0.3
debug1: match: OpenSSH_8.9p1 Ubuntu-3ubuntu0.3 pat OpenSSH* compat 0x04000000
debug1: Authenticating to *****:*** as ubuntu
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server-client cipher: chacha20-poly1305openssh.com MAC: implicit
# ....估摸着跟认证方式差异有关系密钥认证没整上或者到这个地方超时了然后就重置。 修改了下server上的/etc/ssh/sshd_config文件只保留了密钥登录选项其他的都是no。 重启之后连上了有没有用后面再说。 跑了三天暂时还算OK。 初步认定问题已经解决后面有问题再继续说。