If you own a VPS and want to manage it remotely via SSH, this guide will provide detailed, easy-to-follow instructions to help you get started. With just a few simple steps, you will quickly master connecting to and controlling your VPS through the Terminal on your Linux computer.
Prepare Required Information Before getting started, ensure you have the following information from your VPS provider:
VPS IP address: For example, 123.456.789.101
Username: Typically root
Password: Provided when you set up or rent the VPS (or SSH key if you're using it for authentication).
Additionally, check if your computer has an SSH client installed. Most Linux distributions like Ubuntu, CentOS, or AlmaLinux come with the SSH client pre-installed.
How to Connect to SSH Using Terminal Step 1: Open Terminal On your Linux computer, you can press the Ctrl + Alt + T key combination to open the Terminal. This is the main tool you will use to connect to your VPS.
Step 2:
Use the SSH Command The SSH connection command syntax is:
ssh username@IP_address
Example:
ssh root@123.456.789.101
root: Username.
123.456.789.101: VPS IP address.
Step 3:
Enter the Password Once the command is executed, the system will prompt you to enter the password. Note that nothing will show up as you type, but continue typing your password and press Enter.
If the information is correct, you will see the VPS command prompt, indicating a successful connection.
Common Errors and How to Fix Them
Error “Connection refused”: The VPS may not have SSH port open, or the firewall may be blocking it. Check and ensure that port 22 is open.
Error “Permission denied”: Incorrect login credentials. Double-check your username and password.
Error “Host key verification failed”: Old authentication data may be causing a conflict. Use the following command to delete the old key:
ssh-keygen -R IP_address
Useful Tips When Using SSH
To exit a session, you can use the exit command.
If the VPS uses a different SSH port (other than 22), add the -p flag when connecting:
ssh root@123.456.789.101 -p 2222
Set up SSH keys for automatic login without entering a password each time.
With the steps above, you can easily manage your VPS via SSH. We wish you success in managing your VPS and enjoying efficient remote administration!