跳至主要內容
  • Hostloc 空間訪問刷分
  • 售賣場
  • 廣告位
  • 賣站?

4563博客

全新的繁體中文 WordPress 網站
  • 首頁
  • vultr,linode,ssh改端口后都出现connection refused?
未分類
3 7 月 2020

vultr,linode,ssh改端口后都出现connection refused?

haole 大佬有话说 :

vultr,linode,ssh改端口后都出现connection refused?

本帖最后由 haole 于 2020-7-3 20:21 编辑

都是centos7
vi /etc/ssh/sshd_config
里面添加了port 12345
出于方便,我直接把防火墙永久关闭了。
但是putty连接ssh12345,出现network error: connection refused。
同样的方法,我在hostyun就没问题。
那vultr和linode,到底怎么改centos7的端口啊。毕竟不改端口频繁有人连挺耗费资源的。

ByteCat 大佬有话说 :

selinux 安全设置看看https://cdn.jsdelivr.net/gh/hishis/forum-master/public/images/patch.gif

loveqianool 大佬有话说 :

本帖最后由 loveqianool 于 2020-7-3 20:24 编辑

改了后要重启 sshd 服务。

sed -e "s/^#?Port.*/Port 1234/g"
-e "s/^#?PermitRootLogin.*/PermitRootLogin prohibit-password/g"
-e "s/^#?IgnoreUserKnownHosts.*/IgnoreUserKnownHosts yes/g"
-e "s/^#?PubkeyAuthentication.*/PubkeyAuthentication yes/g"
-e "s/^#?PasswordAuthentication.*/PasswordAuthentication no/g"
-e "s/^#?GSSAPIAuthentication.*/GSSAPIAuthentication no/g" -i /etc/ssh/sshd_config &&
grep -E ‘PubkeyAuthentication|PermitRootLogin|PasswordAuthentication|GSSAPIAuthentication|IgnoreUserKnownHosts|Port’ /etc/ssh/sshd_config &&
systemctl restart sshd

haole 大佬有话说 :

ByteCat 大佬有话说 : 2020-7-3 20:21
selinux 安全设置看看

我vultr选的centos7 without selinux

jac360 大佬有话说 :

设置错了把

文章導覽

上一篇文章
下一篇文章

AD

其他操作

  • 登入
  • 訂閱網站內容的資訊提供
  • 訂閱留言的資訊提供
  • WordPress.org 台灣繁體中文

51la

4563博客

全新的繁體中文 WordPress 網站
返回頂端
本站採用 WordPress 建置 | 佈景主題採用 GretaThemes 所設計的 Memory
4563博客
  • Hostloc 空間訪問刷分
  • 售賣場
  • 廣告位
  • 賣站?
在這裡新增小工具