In the / etc / ssh / sshd_config file, I changed the line Port 22 to Port 68 . Now, not via SSH, not via SFTP, do not connect. I suspect that the port itself is not open somewhere in iptables.

Advise me how to make it possible to use a non-standard port?

  • Not properly. It is necessary, first - to prescribe TWO ports. Reload SSHd. Try on the second. If there is no connection, then check the rule in iptable-ipfw, if not - add by analogy with port 22. Try again. If connects, then 22 can be removed. Yes, in theory, when changing ports, the server will not break the current connection, but what if there are problems with the connection ... Therefore, first set up a new one - then disconnect the old one. - SilverIce

2 answers 2

I didn’t forget to restart sshd by chance and specify this modified port as well. Ssh -p 68

    1. changes in sshd_config Port settings

    2.If the policy is CLOSED ALL that is not OPEN, it is added to the firewall rules.

    3.restart sshd

    4. checking remotely via telnet yourip 68