LionelK
V2EX  ›  问与答

digitalocean 不能自行修改 ssh 端口?

  •  
  •   LionelK · May 25, 2015 · 4870 views
    This topic created in 4034 days ago, the information mentioned may be changed or developed.
    系统centos7,修改/etc/ssh/sshd_config的port后,重启发现修改后的端口不能登陆,还是只能使用22...请问有人知道原因吗?
    6 replies    2018-11-26 09:15:29 +08:00
    jaleo
        1
    jaleo  
       May 25, 2015
    可能是centos 7 的防火墙关系
    修改SSH端口后,试试下面两个命令
    firewall-cmd --permanent --add-port=443/tcp (443改为你需要的端口)
    firewall-cmd --reload
    lyragosa
        2
    lyragosa  
       May 25, 2015
    还好我只用centos6.5……
    LionelK
        3
    LionelK  
    OP
       May 25, 2015
    @jaleo 貌似也不是这个原因,因为我是直接把22修改掉的,22应该已经不能登陆了,但我还可以用22连上
    LazyZhu
        4
    LazyZhu  
       May 25, 2015
    去检查下到底改了没, 说下怎么修改的?
    amphineko
        5
    amphineko  
       May 26, 2015 via iPhone
    也有可能是 SELinux?
    talas
        6
    talas  
       Nov 26, 2018
    应该是 SELinux 缘故,我整理了下修改 ssh 端口的流程: http://amon.org/ssh
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2689 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 15:42 · PVG 23:42 · LAX 08:42 · JFK 11:42
    ♥ Do have faith in what you're doing.