SSH连接不上Linux 问题解决
linux-dash
A beautiful web dashboard for Linux
项目地址:https://gitcode.com/gh_mirrors/li/linux-dash

·
查看linux 端口监听
#netstat -tnlp | grep ssh
以上图,说明该ssh是开着的, 连接端口是78
然后打开安全组 78 即可
修改该端口为:22
#vim /etc/ssh/sshd_config
输入e 进入该文件
多加一个端口。22端口
注意:1.将你的服务器安全组的端口打开,不然是连接不上去的。
2.查看防火墙是否开启
1查看防火墙状态
#systemctl status firewalld
出现 Active: inactive (dead)灰色表示停止,看单词也行。
出现Active: active (running)切高亮显示则表示是启动状态。
3.如果是关闭,什么也不关.只需要开启安全组端口即可,否则执行下面的
2查询端口是否开放
#firewall-cmd --query-port=8080/tcp
3开放80端口
#firewall-cmd --permanent --add-port=80/tcp
4移除端口
#firewall-cmd --permanent --remove-port=8080/tcp
5重启防火墙(修改配置后要重启防火墙)
#firewall-cmd --reload
然后保存
然后运行重启 ssh
#service sshd reload
接下来用ssh 测试你设置的端口是否能够连接上去,
好连接成功说明你修改的端口可用,再去把之前的端口删除,重新启动ssh
修改完成




A beautiful web dashboard for Linux
最近提交(Master分支:5 个月前 )
186a802e
added ecosystem file for PM2 4 年前
5def40a3
Add host customization support for the NodeJS version 4 年前
更多推荐
所有评论(0)