Get your free beta license ↗
FTP, SFTP and SSH · OpenSSH

An SSH port change is undone after five minutes

Last updated 30 Nov 2026
Summary

Five minutes after you change the SSH port in UrbeStack, OpenSSH returns to the old port and the new port closes. UrbeStack reverts the change to prevent a lockout unless you log in on the new port or confirm the change.

Symptoms

After you run urbestack-setting-set --key ssh.port --value 2222, UrbeStack prints the following message.

Output
| UrbeStack: Change armed for revert at 08:59:14 UTC                           |
| sshd now listens on 22 and 2222; the firewall allows both.                   |
| Log in on port 2222 from a NEW session: that login confirms the move on its  |
| own. This session survives either way.                                       |

Five minutes later, sshd listens only on the old port, and the new port is closed.

Cause

UrbeStack sets a deadline to revert changes that could lock you out, including an SSH port change. During the five minutes before that deadline, sshd listens on both ports and the firewall allows both.

Logging in on the new port from a new session confirms the change automatically. UrbeStack reverts the change at the deadline unless you log in on the new port or confirm the change from your current session.

Resolution

  1. If your hosting provider has its own firewall, open the new port there first.

  2. Run urbestack-setting-set --key ssh.port --value 2222 again. Then log in on the new port from a new session.

    ssh -p 2222 root@server.example.net
  3. You can also confirm the change from your current session.

    urbestack-firewall-confirm
  4. Check whether a change is pending and when it will revert.

    urbestack-firewall-status
  5. To undo a pending change immediately, run urbestack-firewall-revert.