# An SSH port change is undone after five minutes

UrbeStack sysadmin note about OpenSSH. Last updated 30 Nov 2026.

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

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

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
```

You can also confirm the change from your current session.

```
urbestack-firewall-confirm
```

Check whether a change is pending and when it will revert.

```
urbestack-firewall-status
```

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

If the problem persists after you follow this note, you can [open a support ticket](https://support.urbestack.com/new?type=support). Including the output of the commands you ran helps support diagnose the problem.
