Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


SSH Fails After Changing Port and Reboot Server
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

SSH Fails After Changing Port and Reboot Server

BardulfBardulf Member

Hi,
I changed ssh port, I work well before after I reboot my server, after that I lost access to ssh and can't login to server, I don't change root access in sshd_config, just change port to 22000, anyone know what I done wrong?

Comments

  • donlidonli Member
    edited May 2019

    Hard to say what exactly you did wrong just that you did. A common error these days when you change the sshd port is you are running a firewall and failed to put a rule in to allow access to the new port.

    Whenever you change sshd_config (1) Make a backup copy first. (2) test your new config
    before logging out of the session on the original port (you can even try sshd with a new test config file with a command like: /usr/sbin/sshd -f /etc/ssh/sshd-config.test ).

    You can fix what you did if your VPS/server control panel supports console access - does it?

    Thanked by 1uptime
  • vnc in and check firewall maybe

    Thanked by 2Bardulf uptime
  • BardulfBardulf Member

    donli said: When ever you change sshd_config (1) Make a backup copy first. (2) test your new config before logging out of the session on the original port.

    I test new port and it works well

    donli said: You can fix what you did if your control panel supports console access - does it?

    unfortunately it doesn't have console, I must reinstall server.

  • BardulfBardulf Member

    @cybertech said:
    vnc in and check firewall maybe

    That was my bad I changed iptable roles and it works well

    Thanked by 1uptime
  • cybertechcybertech Member
    edited May 2019

    No worries mate I make that mistake all the time too

    Woes of the amateur

  • NanoG6NanoG6 Member

    If not firewall, then it must be selinux

    Thanked by 1uptime
Sign In or Register to comment.