A secure home for your next big idea. Explore hosting →

Knowledgebase / Linux and Server Management

How to Connect to a Linux VPS Using SSH

Open an authenticated SSH session to your VPS, verify the server identity and diagnose connection failures without weakening access controls.

Prerequisites

Obtain the VPS hostname or IP, SSH port, authorized username and authentication method from the provider. Confirm that your account has SSH access and that you have a recovery console available. A web-hosting account and a VPS may have different permissions.

Use an SSH client supplied by your operating system or a trusted vendor. The examples use placeholders, not ServersNest connection details. Never copy a private key, password or one-time code into a public support conversation.

Step 1: Prepare authentication

If the server uses key authentication, its authorized account must contain your public key. Keep the corresponding private key on your trusted device and protect it with an appropriate passphrase and filesystem permissions. A public key can be installed through the provider’s supported access workflow.

Do not replace an existing authorized_keys file wholesale when adding a key; it may contain other approved administrators’ access. If the provider gives a temporary password, follow its secure setup process and plan the approved credential rotation separately.

Step 2: Connect with explicit values

A typical command has this structure:

ssh -p SSH_PORT USERNAME@SERVER_HOST

Replace all uppercase placeholders with verified account details. To select a particular private key, use the client option -i /path/to/private_key with your actual local file. Do not put the password in the command line.

On first connection, compare the displayed host-key fingerprint against an independent trusted value from the provider or server console before accepting it. The host key identifies the server; your own login key identifies you. They serve different purposes.

Step 3: Verify the session

After authentication, run read-only commands such as whoami, hostname and pwd. Confirm that you reached the intended account and machine before changing anything. Use an ordinary authorized account and elevate only for administrative tasks that need it.

When finished, type exit. A disconnected terminal does not guarantee a foreground task completed; use a suitable session-management approach for long maintenance work after confirming your requirements.

Troubleshooting common failures

A timeout suggests checking the destination, port, provider firewall and network path. Connection refused can mean no service is listening on that port. Permission denied points toward the username, key selection, authorized key or authentication policy. These errors require different checks.

If a host-key warning reports a changed identity, stop and verify whether the server was rebuilt or its keys were intentionally rotated. Do not erase the known-host entry just to bypass the warning. Obtain the new fingerprint through a trusted channel first.

Verbose client output can help identify the failing stage, but review it before sharing because it can reveal usernames, hostnames and local paths. Never include private-key contents.

Expected result

You should have a verified session under the intended account with only the required access. Test a second authorized session before changing SSH authentication settings, and retain console recovery access during any later hardening work.

Frequently asked questions

Should I connect as root?

Use the authorized account supplied for your service and elevate only when needed.

Can I ignore a changed host-key warning?

No. Verify the new fingerprint through a trusted channel before trusting the server.

Why does the command not show my password?

SSH password prompts normally do not echo typed characters. Enter it only after verifying the server.

Related guides and hosting options

Compare VPS hosting against your application requirements. Confirm available tools and management responsibilities for your own account. For account-specific help, open a private support ticket with the domain, time and relevant redacted error.

Official references