Hello everyone, welcome back to CybercityHelp. Whenever we buy a VPS server, the hosting provider usually does not directly give us terminal or command line access. Instead, they only provide us with a public IP address and a randomly generated password of the VPS. So naturally, the question comes that how exactly do we connect to the VPS using this information??
So in our today’s article, we are going to share the complete process by which you can easily connect your VPS server to your terminal or any command line interface using the IP address and the random password provided by your VPS provider. Now let’s get started.
How to Connect VPS server to Command Line Interface?
Connecting a VPS server to the command line is not as difficult as it initially looks. Once you understand the basic flow, the process becomes simple. Here’s what you need to follow:
Step 1: Generate SSH Key
First of all, you need to generate an SSH key on your local computer. This SSH key will be used to securely authenticate your terminal with the VPS server. To generate the SSH key, open your terminal or command line interface and run the following command:
ssh-keygen.exe
OR
ssh-keygen
Step 2: Enter File Name
After running this command, the terminal will ask you to provide a file name where the SSH key should be saved. It usually suggests a default path like:
C:\Users\your_name/.ssh/id_rsa
You can either press Enter to accept the default location or you can give your own file name like myfile, myfile1, or anything you want. Just remember the file name you choose.
Step 3: Enter Passphrase
After that, the terminal will ask you to enter a passphrase. This passphrase adds an extra layer of security to your SSH key. You can enter any passphrase you want, or you can leave it empty by pressing Enter. If you enter a passphrase, the terminal will ask you to confirm it by typing it again.
Step 4: Login in Terminal Using SSH key and IP address
Once this is done, the SSH key will be generated successfully and you will see a message on your screen showing the key fingerprint and a randomart image, something similar to this:
Your public key has been saved in test.pub
The key fingerprint is:
SHA256:TbTKGR4v7EqIxDMM4OKWcfyrb54ccGnST0rO+V5vSeo user_device_details
The key's randomart image is:
+---[RSA 3072]----+
|. . |
|o . . . |
|oo o o o |
|o++ o .+ O |
| +*o B .S o |
|.. +O.*. . . |
| . .B....o . |
| oo+....o |
| .+=oo.E.. |
+----[SHA256]-----+
PS C:\Users\your_name\Desktop>
After generating the SSH key, open a new terminal tab and type the following command.
ssh root@ip
Note: Here, replace “ip” with the actual public IP address of your VPS server which you got from your hosting provider.
Step 5: Provide password
When you run this command, the terminal will ask you for the password. This is the random generated password that your VPS provider gave you. So go to your VPS provider’s dashboard, copy the password from there, and paste it into the terminal.
Once you enter the correct password, you will be successfully logged into your VPS server through the terminal. That’s it, your VPS server is now connected to your terminal or command line interface and you can start running or deploying your applications, bots, or any other services on it.
Important Note: One important thing to remember is that you should not delete the SSH key file from your computer. If you delete it, your terminal will lose access to the VPS and you will have to generate a new key again. So only delete it if you no longer want to use the VPS server.
Errors You may Face and How to fix them?
While doing the above steps for the first time, I faced few issues to be honest. At one point, I received a “Permission denied” error because the VPS was expecting key-based authentication while I was still trying to use a password. Logging in with the correct method and adding the SSH key fixed that.
I also faced a “Connection timed out” error once, which happened because I entered the wrong IP address. Double-checking the IP and making sure the VPS was running solved the issue. In some cases, the default user may not be root. Some providers use ubuntu or another username, so if root does not work, you can try logging in with a different user.
I shared these errors because it was my first time doing such activities, and I believe lot of beginners might face the same issue, so I am just sharing my experience so that they don’t suffer like me, they should get benefitted from this article.
My Reason: Why I wrote this Article and Why it’s Important to Share?
Let me tell you my experience why I decided to write this article. Actually, when I purchased one VPS server from Hetzner for the first time. After completing the purchase, I received only two things from them. It was just a public IP address and a randomly generated root password. That’s it.
No clear instructions, no guide, no explanation of whether I should use PowerShell, Terminal, PuTTY, or something else. I was genuinely confused at that point because I had never used a VPS before. Since I had never used a VPS before, I was genuinely confused about what to do next.
Then I first searched on YouTube for a solution, but most tutorials either skipped important steps or assumed that I know already about SSH key and everything. So I decided to try on my own. I read documentation, ran commands, got errors, fixed them, and finally managed to connect my VPS successfully.
Then I finally decided that, whatever I learnt from my experience, I should share my experience with everyone, so that they don’t suffer like me, atleast they should get the right solution. That was the reason I shared my experience.
Alright, so this was the complete process of connecting VPS server to command line interface (CLI). We discussed why we need to connect a VPS to the terminal, how to generate an SSH key, how to use the IP address and password to log in, and what things you should take care of after connecting.
We hope this article helped you clearly understand how to connect your VPS server to your terminal and start using it for running your applications, bots, or any other services. In case if you still have any doubts regarding this process or face any issues while connecting, then you can freely tell us in the comment section.
If you want to read more articles related to servers, hosting, or other Google products, then you can check out our related categories from the top menu bar. So stay connected, and that’s all for today’s article. Thank you so much for reading this article till the end!
“So keep learning, keep growing!”


