search

Home  >  Q&A  >  body text

javascript - Ubuntu cannot log in after modifying port

Steps I did:

  1. In the /etc/ssh/sshd_config file, PORT 4000 was added under PORT 22

  2. service ssh restart //Restarted ssh

-> ufw status
Status: inactive //The firewall is not turned on

ssh -p 4000 root@X.X.X.X Unable to log in through port 4000
ssh root@X.X.X.X Can log in through port 22

阿神阿神2728 days ago890

reply all(2)I'll reply

  • 滿天的星座

    滿天的星座2017-06-05 11:11:59

    Personal operating experience on centos7, it should be selinux, which prevents ssh from binding other ports. It is recommended that you check whether ssh has bound the port, or query the ssh log. If you find that port 4000 is not bound to listen, please After closing selinux, start the service

    reply
    0
  • 黄舟

    黄舟2017-06-05 11:11:59

    I'll give it a try, is it ok?

    reply
    0
  • Cancelreply