How to Connect to a NAT VPS with SSH

Updated · Autdo Cloud

Connect to a NAT VPS using its assigned public hostname or IPv4 address, its public SSH port and the username for the installed image. The guest may listen on port 22 even when the public port is different.

Use the displayed endpoint

For an example public port 24022:

ssh -i ~/.ssh/id_ed25519 -p 24022 USER@PUBLIC_HOST
sh

Replace USER, PUBLIC_HOST, the key path and the port with your actual values. The image determines the login user; do not assume every distribution permits root login. Never paste a private SSH key into a support ticket or web form asking for a public key.

Verify host identity

On first connection, compare the server host-key fingerprint through a trusted channel when available. After a legitimate reinstall, the host key may change. Do not blindly disable host-key checking to suppress a warning; investigate unexpected changes first.

If connection fails

A timeout points toward an unreachable path, missing rule, stopped instance or filtering. An authentication failure usually means the TCP connection already reached an SSH server, so check username and key selection. ssh -vv can show which key is offered, but redact identifying and sensitive output before sharing it.

Check the current mapping in the panel rather than assuming an old bookmark is still valid. Reinstallation or instance replacement may change connection details. Keep a second session open when changing SSH or firewall settings.

See SSH key setup, first-login checks and SSH error diagnosis.

Reference: OpenSSH client manual.