{"id":1379,"date":"2026-10-14T11:11:41","date_gmt":"2026-10-14T11:11:41","guid":{"rendered":"https:\/\/www.kailashcloud.com\/blog\/?p=1379"},"modified":"2026-10-14T11:11:43","modified_gmt":"2026-10-14T11:11:43","slug":"what-is-ssh-beginners-guide","status":"publish","type":"post","link":"https:\/\/www.kailashcloud.com\/blog\/what-is-ssh-beginners-guide\/","title":{"rendered":"What Is SSH? A Complete Beginner&#8217;s Guide for VPS Users"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">You&#8217;ve just bought your first <a href=\"https:\/\/www.kailashcloud.com\/blog\/what-is-vps-hosting-beginners-guide\/\">VPS<\/a>, and your hosting provider has sent you a welcome email with an IP address, a username, and a password. But there&#8217;s no familiar dashboard or control panel to manage your server. So, how do you connect to it and start using it?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That&#8217;s where <strong>SSH (Secure Shell)<\/strong> comes in. SSH lets you securely connect to your VPS from your own computer and manage it by typing commands in a terminal. You can use it to install software, configure your server, deploy websites, and much more.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you&#8217;re new to VPS hosting, don&#8217;t worry. You don&#8217;t need to be a Linux expert to get started. In this beginner-friendly guide, you&#8217;ll learn what is SSH, how it works, how to connect to your VPS for the first time, and how to secure your connection.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_87_1 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.kailashcloud.com\/blog\/what-is-ssh-beginners-guide\/#Quick_Answer_What_is_SSH\" >Quick Answer: What is SSH?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.kailashcloud.com\/blog\/what-is-ssh-beginners-guide\/#What_Is_SSH\" >What Is SSH?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.kailashcloud.com\/blog\/what-is-ssh-beginners-guide\/#What_Is_SSH_Used_For_on_a_VPS\" >What Is SSH Used For on a VPS?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.kailashcloud.com\/blog\/what-is-ssh-beginners-guide\/#How_Does_SSH_Work\" >How Does SSH Work?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.kailashcloud.com\/blog\/what-is-ssh-beginners-guide\/#How_to_Connect_to_Your_VPS_Using_SSH\" >How to Connect to Your VPS Using SSH<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.kailashcloud.com\/blog\/what-is-ssh-beginners-guide\/#On_Windows\" >On Windows<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.kailashcloud.com\/blog\/what-is-ssh-beginners-guide\/#On_macOS_or_Linux\" >On macOS or Linux<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.kailashcloud.com\/blog\/what-is-ssh-beginners-guide\/#Basic_SSH_Commands_Every_Beginner_Should_Know\" >Basic SSH Commands Every Beginner Should Know<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.kailashcloud.com\/blog\/what-is-ssh-beginners-guide\/#What_Is_SSH_Key_Authentication\" >What Is SSH Key Authentication?<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.kailashcloud.com\/blog\/what-is-ssh-beginners-guide\/#Step_1_Generate_an_SSH_Key_Pair\" >Step 1: Generate an SSH Key Pair<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.kailashcloud.com\/blog\/what-is-ssh-beginners-guide\/#Step_2_Add_Your_Public_Key_to_the_VPS\" >Step 2: Add Your Public Key to the VPS<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/www.kailashcloud.com\/blog\/what-is-ssh-beginners-guide\/#Step_3_Test_Your_SSH_Key\" >Step 3: Test Your SSH Key<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/www.kailashcloud.com\/blog\/what-is-ssh-beginners-guide\/#How_to_Secure_SSH_on_Your_VPS\" >How to Secure SSH on Your VPS<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/www.kailashcloud.com\/blog\/what-is-ssh-beginners-guide\/#1_Create_a_Regular_User\" >1. Create a Regular User<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/www.kailashcloud.com\/blog\/what-is-ssh-beginners-guide\/#2_Disable_Root_Login_and_Password_Authentication\" >2. Disable Root Login and Password Authentication<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/www.kailashcloud.com\/blog\/what-is-ssh-beginners-guide\/#Common_SSH_Errors_and_How_to_Fix_Them\" >Common SSH Errors and How to Fix Them<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/www.kailashcloud.com\/blog\/what-is-ssh-beginners-guide\/#What_If_the_Servers_Host_Key_Has_Changed\" >What If the Server&#8217;s Host Key Has Changed?<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/www.kailashcloud.com\/blog\/what-is-ssh-beginners-guide\/#Frequently_Asked_Questions_About_SSH\" >Frequently Asked Questions About SSH<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-19\" href=\"https:\/\/www.kailashcloud.com\/blog\/what-is-ssh-beginners-guide\/#What_Is_SSH_in_Simple_Words\" >What Is SSH in Simple Words?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-20\" href=\"https:\/\/www.kailashcloud.com\/blog\/what-is-ssh-beginners-guide\/#What_Is_SSH_Port_22\" >What Is SSH Port 22?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-21\" href=\"https:\/\/www.kailashcloud.com\/blog\/what-is-ssh-beginners-guide\/#What_Is_SSH_Access_on_a_VPS\" >What Is SSH Access on a VPS?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-22\" href=\"https:\/\/www.kailashcloud.com\/blog\/what-is-ssh-beginners-guide\/#What_Is_SSH_Tunnelling\" >What Is SSH Tunnelling?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-23\" href=\"https:\/\/www.kailashcloud.com\/blog\/what-is-ssh-beginners-guide\/#What_Is_SSH_Compared_to_SSL\" >What Is SSH Compared to SSL?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-24\" href=\"https:\/\/www.kailashcloud.com\/blog\/what-is-ssh-beginners-guide\/#Is_SSH_Safe_to_Use\" >Is SSH Safe to Use?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-25\" href=\"https:\/\/www.kailashcloud.com\/blog\/what-is-ssh-beginners-guide\/#What_Happens_If_I_Lose_My_Private_SSH_Key\" >What Happens If I Lose My Private SSH Key?<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-26\" href=\"https:\/\/www.kailashcloud.com\/blog\/what-is-ssh-beginners-guide\/#Final_Thoughts\" >Final Thoughts<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Quick_Answer_What_is_SSH\"><\/span>Quick Answer: What is SSH?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The simplest answer to what is SSH: <strong>SSH (Secure Shell)<\/strong> is a network protocol that lets you securely connect to your VPS from your computer and manage it through a terminal. You can use SSH to run commands, install software, manage files, configure server settings, and deploy websites remotely. It encrypts the connection between your computer and the server, helping protect your login credentials and data.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_Is_SSH\"><\/span>What Is SSH?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">SSH stands for <strong>Secure Shell<\/strong>. It&#8217;s a network protocol that allows you to connect securely to another computer and run commands on it remotely.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Think of SSH as a way to control your VPS from your own computer. Instead of managing the server through a graphical dashboard, you open a terminal, connect to the server, and enter commands.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example, you can use SSH to install software, manage files, restart services, and deploy a website.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">SSH encrypts the communication between your computer and the server, helping protect your login credentials and other information from being read by people monitoring the network.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_Is_SSH_Used_For_on_a_VPS\"><\/span>What Is SSH Used For on a VPS?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">On shared hosting, a control panel handles most of the work for you. A VPS gives you full control of the whole server instead, which is the key difference explained in our <a href=\"https:\/\/www.kailashcloud.com\/blog\/shared-hosting-vs-vps-vs-cloud-hosting\/\">shared hosting vs VPS vs cloud hosting comparison<\/a>. That control comes through SSH, so on a VPS almost every task starts with an SSH session. You&#8217;ll use it to:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Install and update software<\/li>\n\n\n\n<li>Manage files and folders<\/li>\n\n\n\n<li>Restart services like your web server<\/li>\n\n\n\n<li>Deploy a website or application<\/li>\n\n\n\n<li>Check disk space, memory, and server load<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_Does_SSH_Work\"><\/span>How Does SSH Work?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">SSH uses two main components:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>SSH client:<\/strong> The program on your computer that connects to the server. Most systems use <a href=\"https:\/\/www.openssh.com\/\" target=\"_blank\" rel=\"noopener\">OpenSSH<\/a>.<\/li>\n\n\n\n<li><strong>SSH server:<\/strong> The software running on your VPS that accepts incoming SSH connections. On Linux, this service is usually called <code>sshd<\/code>.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">By default, SSH uses <strong>TCP port 22<\/strong>. Some providers configure a different port, so check your VPS details before connecting.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When you connect, SSH verifies the server&#8217;s identity, establishes an encrypted connection, and authenticates your login.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1844\" height=\"853\" src=\"https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/10\/how_does_ssh_work.png\" alt=\"How an SSH connection between your computer and a VPS works\" class=\"wp-image-1382\" srcset=\"https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/10\/how_does_ssh_work.png 1844w, https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/10\/how_does_ssh_work-300x139.png 300w, https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/10\/how_does_ssh_work-1024x474.png 1024w, https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/10\/how_does_ssh_work-768x355.png 768w, https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/10\/how_does_ssh_work-1536x711.png 1536w, https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/10\/how_does_ssh_work-528x244.png 528w, https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/10\/how_does_ssh_work-1056x488.png 1056w, https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/10\/how_does_ssh_work-820x379.png 820w, https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/10\/how_does_ssh_work-1240x574.png 1240w\" sizes=\"auto, (max-width: 1844px) 100vw, 1844px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_Connect_to_Your_VPS_Using_SSH\"><\/span>How to Connect to Your VPS Using SSH<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To connect to your VPS, you&#8217;ll need its IP address, username, and password or SSH key. Your provider usually supplies these details when your server is created.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"On_Windows\"><\/span>On Windows<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Windows 10 and 11 generally support SSH through the built-in OpenSSH client.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step 1: Open PowerShell or Windows Terminal.<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Open the Start menu, search for PowerShell, and launch it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step 2: Check whether SSH is installed.<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Run:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ssh<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If you see usage instructions, the SSH client is available. Otherwise, install <strong>OpenSSH Client<\/strong> through Windows Optional Features.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For step-by-step instructions, follow Microsoft&#8217;s guide: <a href=\"https:\/\/learn.microsoft.com\/en-us\/windows-server\/administration\/openssh\/openssh_install_firstuse\" target=\"_blank\" rel=\"noopener\">Install OpenSSH on Windows<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step 3: Connect to your VPS.<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Run the following command, replacing the example username and IP address with your actual details:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ssh root@203.0.113.25<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If your provider uses a different port, such as <code>2222<\/code>, run:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ssh -p 2222 root@203.0.113.25<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step 4: Verify the server and log in.<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">On your first connection, SSH may ask you to verify the server&#8217;s identity.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If your provider supplies a host key fingerprint, verify it before accepting the connection. Then type <code>yes<\/code> if the identity matches.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Enter your password when prompted. You won&#8217;t see any characters while typing, which is normal. Press Enter when finished.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If authentication succeeds, you&#8217;re connected to your VPS.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1585\" height=\"992\" src=\"https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/10\/ssh_login.png\" alt=\"Connecting to a VPS using SSH in Windows PowerShell\" class=\"wp-image-1383\" srcset=\"https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/10\/ssh_login.png 1585w, https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/10\/ssh_login-300x188.png 300w, https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/10\/ssh_login-1024x641.png 1024w, https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/10\/ssh_login-768x481.png 768w, https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/10\/ssh_login-1536x961.png 1536w, https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/10\/ssh_login-528x330.png 528w, https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/10\/ssh_login-1056x661.png 1056w, https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/10\/ssh_login-820x513.png 820w, https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/10\/ssh_login-1240x776.png 1240w\" sizes=\"auto, (max-width: 1585px) 100vw, 1585px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"On_macOS_or_Linux\"><\/span>On macOS or Linux<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Open Terminal and run the same SSH command:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ssh root@203.0.113.25<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For a custom port, use the <code>-p<\/code> option as shown earlier.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The connection process is the same: verify the server&#8217;s identity and authenticate using the configured login method.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Basic_SSH_Commands_Every_Beginner_Should_Know\"><\/span>Basic SSH Commands Every Beginner Should Know<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Once connected, you can use commands to check your server and perform basic tasks.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><th>Command<\/th><th>What it does<\/th><\/tr><tr><td><code>whoami<\/code><\/td><td>Shows your current username<\/td><\/tr><tr><td><code>pwd<\/code><\/td><td>Shows your current directory<\/td><\/tr><tr><td><code>ls -la<\/code><\/td><td>Lists files, including hidden files<\/td><\/tr><tr><td><code>df -h<\/code><\/td><td>Shows available disk space<\/td><\/tr><tr><td><code>uptime<\/code><\/td><td>Shows how long the server has been running and its system load<\/td><\/tr><tr><td><code>exit<\/code><\/td><td>Closes your SSH session<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">For example, run:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>whoami<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If you&#8217;re logged in as root, the output will normally be <code>root<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To disconnect from the VPS when you&#8217;re finished, run:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>exit<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">These commands are enough to get you familiar with the terminal. You can learn more advanced commands as you begin managing your website or application.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_Is_SSH_Key_Authentication\"><\/span>What Is SSH Key Authentication?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">SSH supports password authentication and key-based authentication. <strong>SSH keys are generally recommended for VPS administration<\/strong> because they reduce reliance on passwords.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">An SSH key pair contains two files:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Private key:<\/strong> Stored on your computer. Keep it secret and never share it.<\/li>\n\n\n\n<li><strong>Public key:<\/strong> Added to the server so it can verify that you possess the matching private key.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">When you connect, your computer uses the private key to prove your identity. The private key itself is never sent to the server.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_1_Generate_an_SSH_Key_Pair\"><\/span>Step 1: Generate an SSH Key Pair<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Run this command on your own computer, not on your VPS:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ssh-keygen -t ed25519 -C \"you@example.com\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Replace the example label with one that helps you identify the key.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Press Enter to accept the default file location, and set a passphrase when prompted.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The command normally creates these files:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>~\/.ssh\/id_ed25519\n~\/.ssh\/id_ed25519.pub<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The first is your private key; the second is your public key.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_2_Add_Your_Public_Key_to_the_VPS\"><\/span>Step 2: Add Your Public Key to the VPS<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">On macOS or many Linux distributions, you can use:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ssh-copy-id root@203.0.113.25<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">On Windows, you can display your public key in PowerShell:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Get-Content \"$HOME\\.ssh\\id_ed25519.pub\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Copy the output, connect to your VPS using your existing login method, and run these commands on the server:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mkdir -p ~\/.ssh\nchmod 700 ~\/.ssh\nnano ~\/.ssh\/authorized_keys<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Paste your public key on its own line. In Nano, save using <code>Ctrl+O<\/code>, press Enter, and exit using <code>Ctrl+X<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Then run:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>chmod 600 ~\/.ssh\/authorized_keys<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Make sure the file belongs to the account you&#8217;re configuring and that its ownership and permissions are correct.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_3_Test_Your_SSH_Key\"><\/span>Step 3: Test Your SSH Key<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Open a new terminal window and try connecting again:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ssh root@203.0.113.25<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If everything is configured correctly, you should be able to authenticate without entering the server account&#8217;s password. You may still need to enter your private key&#8217;s passphrase.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Keep your existing session open until you&#8217;ve confirmed that the new login works.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_Secure_SSH_on_Your_VPS\"><\/span>How to Secure SSH on Your VPS<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">After setting up SSH, take a few basic steps to protect your server.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_Create_a_Regular_User\"><\/span>1. Create a Regular User<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>root<\/code> account has full administrative privileges. A mistake while using it can affect the entire server.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">On Ubuntu or Debian, create a regular user and grant sudo access:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>adduser deploy\nusermod -aG sudo deploy<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">On AlmaLinux or Rocky Linux, the administrative group is usually <code>wheel<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>adduser deploy\npasswd deploy\nusermod -aG wheel deploy<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Replace <code>deploy<\/code> with your preferred username.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Install your public key for the new user and verify that you can connect:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ssh deploy@203.0.113.25<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Test administrative access with:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo whoami<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If sudo is configured correctly, the output should be <code>root<\/code>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_Disable_Root_Login_and_Password_Authentication\"><\/span>2. Disable Root Login and Password Authentication<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Once you&#8217;ve confirmed that your regular user can connect using an SSH key, you can disable direct root login and password-based SSH authentication.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Open the SSH configuration file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo nano \/etc\/ssh\/sshd_config<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Set these options:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>PermitRootLogin no\nPasswordAuthentication no<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Additional configuration files may override these settings, so check the effective configuration before proceeding:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo sshd -T | grep -E '^(permitrootlogin|passwordauthentication) '<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The intended values are <code>permitrootlogin no<\/code> and <code>passwordauthentication no<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Validate the configuration:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo sshd -t<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If there are no errors, restart SSH.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">On Ubuntu or Debian:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl restart ssh<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">On AlmaLinux or Rocky Linux:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl restart sshd<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Keep your current session open and test a new connection before disconnecting.<\/strong> If you cannot log in, use your provider&#8217;s console to recover access.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Also remember to keep your operating system updated, configure a firewall to allow only necessary ports, and maintain regular backups.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Common_SSH_Errors_and_How_to_Fix_Them\"><\/span>Common SSH Errors and How to Fix Them<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">You may encounter errors when connecting to your VPS. Here are some common ones and what they usually mean.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><th>Error<\/th><th>Possible cause<\/th><th>What to check<\/th><\/tr><tr><td><code>Connection refused<\/code><\/td><td>SSH isn&#8217;t accepting connections on that port<\/td><td>SSH service and port settings<\/td><\/tr><tr><td><code>Connection timed out<\/code><\/td><td>Network traffic isn&#8217;t reaching the SSH service<\/td><td>IP address and firewall rules<\/td><\/tr><tr><td><code>Permission denied (publickey)<\/code><\/td><td>The server rejected your SSH key<\/td><td>Username, public key, permissions, and SSH configuration<\/td><\/tr><tr><td><code>Permission denied, please try again<\/code><\/td><td>The password was rejected<\/td><td>Username and password<\/td><\/tr><tr><td><code>REMOTE HOST IDENTIFICATION HAS CHANGED<\/code><\/td><td>The server&#8217;s host key differs from the saved identity<\/td><td>Whether the server was rebuilt or its identity changed<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_If_the_Servers_Host_Key_Has_Changed\"><\/span>What If the Server&#8217;s Host Key Has Changed?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">This warning can appear after reinstalling a VPS, but it can also indicate an unexpected security issue.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Don&#8217;t ignore it without investigating. If you&#8217;ve confirmed through a trusted source that the server&#8217;s identity has legitimately changed, remove the old entry:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ssh-keygen -R 203.0.113.25<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Reconnect and verify the new fingerprint before accepting it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you&#8217;re completely locked out, check whether your provider offers a web console or rescue environment. These tools can help you repair a broken SSH configuration or restart the SSH service.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Frequently_Asked_Questions_About_SSH\"><\/span>Frequently Asked Questions About SSH<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_Is_SSH_in_Simple_Words\"><\/span>What Is SSH in Simple Words?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">SSH is a secure way to connect to another computer and control it remotely using commands. On a VPS, it lets you manage your server from your own computer.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_Is_SSH_Port_22\"><\/span>What Is SSH Port 22?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Port 22 is the default TCP port used by SSH. If your server uses a different port, specify it with the <code>-p<\/code> option when connecting.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_Is_SSH_Access_on_a_VPS\"><\/span>What Is SSH Access on a VPS?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">It&#8217;s your permission to log in to the server over SSH. A VPS includes it by default, usually as the <code>root<\/code> user, and you can add more users with their own keys.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_Is_SSH_Tunnelling\"><\/span>What Is SSH Tunnelling?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">It sends another connection through your encrypted SSH session. For example, you can reach a database on your VPS without opening its port to the internet.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_Is_SSH_Compared_to_SSL\"><\/span>What Is SSH Compared to SSL?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">SSH secures your login to the server. SSL (TLS) secures the connection between visitors and your website. A live website usually needs both.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Is_SSH_Safe_to_Use\"><\/span>Is SSH Safe to Use?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Yes. SSH encrypts your connection and verifies the server. Learn more about <a href=\"https:\/\/www.cloudflare.com\/learning\/access-management\/what-is-ssh\/\" target=\"_blank\" rel=\"noopener\">how SSH encryption works<\/a>. For extra safety, use keys and keep your server updated.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_Happens_If_I_Lose_My_Private_SSH_Key\"><\/span>What Happens If I Lose My Private SSH Key?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">It can&#8217;t be recovered. Use another key or your provider&#8217;s console to log in, remove the old public key, and add a new one.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Final_Thoughts\"><\/span>Final Thoughts<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Understanding what is SSH and how it works gives you a solid foundation for managing your VPS securely. It allows you to connect to your server remotely, run commands, install software, and troubleshoot issues without needing direct access to the machine.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">As you put what you&#8217;ve learned into practice, start with basic SSH commands, configure SSH key authentication, and create a regular administrative user. Remember to review your security settings to help protect your server from unauthorised access.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You don&#8217;t need to master everything at once. Keep practising, take things one step at a time, and you&#8217;ll gradually gain the confidence to manage your VPS and host websites or applications securely.<\/p>\n","protected":false},"excerpt":{"rendered":"You&#8217;ve just bought your first VPS, and your hosting provider has sent you a welcome email with an&hellip;","protected":false},"author":4,"featured_media":1384,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"csco_display_header_overlay":false,"csco_singular_sidebar":"","csco_page_header_type":"","csco_page_load_nextpost":"","csco_post_video_location":[],"csco_post_video_location_hash":"","csco_post_video_url":"","csco_post_video_bg_start_time":0,"csco_post_video_bg_end_time":0,"csco_post_video_bg_volume":false,"footnotes":""},"categories":[79],"tags":[99,96,95,97,98],"class_list":["post-1379","post","type-post","status-publish","format-standard","has-post-thumbnail","category-vps-hosting","tag-linux-server","tag-secure-shell","tag-ssh","tag-ssh-keys","tag-vps","cs-entry","cs-video-wrap"],"_links":{"self":[{"href":"https:\/\/www.kailashcloud.com\/blog\/wp-json\/wp\/v2\/posts\/1379","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kailashcloud.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kailashcloud.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kailashcloud.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kailashcloud.com\/blog\/wp-json\/wp\/v2\/comments?post=1379"}],"version-history":[{"count":4,"href":"https:\/\/www.kailashcloud.com\/blog\/wp-json\/wp\/v2\/posts\/1379\/revisions"}],"predecessor-version":[{"id":1386,"href":"https:\/\/www.kailashcloud.com\/blog\/wp-json\/wp\/v2\/posts\/1379\/revisions\/1386"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.kailashcloud.com\/blog\/wp-json\/wp\/v2\/media\/1384"}],"wp:attachment":[{"href":"https:\/\/www.kailashcloud.com\/blog\/wp-json\/wp\/v2\/media?parent=1379"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kailashcloud.com\/blog\/wp-json\/wp\/v2\/categories?post=1379"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kailashcloud.com\/blog\/wp-json\/wp\/v2\/tags?post=1379"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}