{"id":12381,"date":"2025-04-25T14:23:08","date_gmt":"2025-04-25T14:23:08","guid":{"rendered":"https:\/\/hostnoc-revamp.branex.org\/blog\/?p=12381"},"modified":"2025-04-25T14:23:08","modified_gmt":"2025-04-25T14:23:08","slug":"how-to-connect-to-your-vps-using-ssh","status":"publish","type":"post","link":"https:\/\/hostnoc-revamp.branex.org\/blog\/how-to-connect-to-your-vps-using-ssh\/","title":{"rendered":"How to Connect to Your VPS Using SSH?"},"content":{"rendered":"<h2><span style=\"font-weight: 400;\">What You&#8217;ll Need Before You Connect?<\/span><\/h2>\n<h3><span style=\"font-weight: 400;\">VPS Access Credentials:<\/span><\/h3>\n<p>&nbsp;<\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><b>IP address:<\/b><span style=\"font-weight: 400;\"> The IP address of your virtual private server.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><b>SSH Port:<\/b><span style=\"font-weight: 400;\"> By default, SSH uses <\/span><b>port 22<\/b><span style=\"font-weight: 400;\">. If your VPS is using a different port for security reasons, make sure you know the correct one.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><b>Username: <\/b><span style=\"font-weight: 400;\">Typically, the username will be root for Linux-based VPS but it may vary depending on your VPS provider or your setup.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><b>Password or SSH Key:<\/b><span style=\"font-weight: 400;\"> If you are connecting using a password, you will need the password for the username. Alternatively, you may use an SSH key for more secure and password-less login.<\/span><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h3><span style=\"font-weight: 400;\">SSH Client:<\/span><\/h3>\n<p>&nbsp;<\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><b>Linux\/Mac: <\/b><span style=\"font-weight: 400;\">These operating systems have SSH pre-installed.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><b>Windows:<\/b><span style=\"font-weight: 400;\"> Windows 10 and newer have an integrated SSH client. If you are using an older version of Windows or prefer a graphical interface, you can use tools like PuTTY or MobaXterm.<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2><span style=\"font-weight: 400;\">Connecting to Your VPS Using SSH<\/span><\/h2>\n<h3><span style=\"font-weight: 400;\">1. Open a Terminal (Linux\/Mac) or SSH Client (Windows)<\/span><\/h3>\n<p>&nbsp;<\/p>\n<ul>\n<li aria-level=\"1\"><b>Linux\/Mac:<\/b><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">Open the terminal on your computer. You can usually find it in your applications folder or by searching for &#8220;<\/span><b>Terminal<\/b><span style=\"font-weight: 400;\">.&#8221;<\/span><\/p>\n<p>&nbsp;<\/p>\n<ul>\n<li aria-level=\"1\"><b>Windows:<\/b><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">For newer versions of Windows such as Windows 10, you can use the integrated Windows Terminal or Command Prompt. Alternatively, you can use third-party applications like <\/span><b>PuTTY<\/b><span style=\"font-weight: 400;\"> or <\/span><b>MobaXterm<\/b><span style=\"font-weight: 400;\">.<\/span><\/p>\n<h3><span style=\"font-weight: 400;\">2. Use the SSH Command to Connect<\/span><\/h3>\n<p>&nbsp;<\/p>\n<ul>\n<li aria-level=\"1\"><b>Linux\/Mac:<\/b><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">In the terminal, type the following command:<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>ssh username@your_vps_ip_address<\/b><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">Replace username with the appropriate user for your virtual private server (e.g., root or any custom user you have set up) and your_vps_ip_address with the actual IP address of your VPS.<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>Example:<\/b><b><br \/>\n<\/b><b><br \/>\n<\/b><b>ssh root@192.168.1.1<\/b><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">If your VPS Using SSH uses a non-default port (other than <\/span><b>port 22<\/b><span style=\"font-weight: 400;\">) use the <\/span><b>-p <\/b><span style=\"font-weight: 400;\">flag to specify the port:<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>ssh -p 2222 root@192.168.1.1<\/b><\/p>\n<p>&nbsp;<\/p>\n<ul>\n<li aria-level=\"1\"><b>Windows (Using Windows Terminal or Command Prompt):<\/b><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">In the terminal or command prompt, use the same SSH command as Linux\/macOS:<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><b> ssh username@your_vps_ip_address<\/b><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight: 400;\">If you are using <\/span><b>PuTTY<\/b><span style=\"font-weight: 400;\">, open the application and enter your VPS&#8217;s IP address in the &#8220;<\/span><b>Host Name<\/b><span style=\"font-weight: 400;\">&#8221; field. Set the port (usually <\/span><b>22<\/b><span style=\"font-weight: 400;\">, unless specified otherwise) and choose the SSH protocol. Click &#8220;<\/span><b>Open<\/b><span style=\"font-weight: 400;\">&#8221; to connect.<\/span><\/p>\n<h3><span style=\"font-weight: 400;\">3. Authenticate Using Password or SSH Key<\/span><b><\/b><\/h3>\n<p>&nbsp;<\/p>\n<ul>\n<li aria-level=\"1\"><b>Password Authentication:<\/b><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">If you are using a password, after executing the SSH command, you will be prompted to enter the password for the username you have used. Type your password and press <\/span><b>Enter. <\/b><span style=\"font-weight: 400;\">Remember that the characters won\u2019t appear on the screen, but they are being typed. If everything is correct, you should be logged in to your <\/span><a href=\"https:\/\/hostnoc-revamp.branex.org\/blog\/what-is-vps-hosting\/\"><span style=\"font-weight: 400;\">virtual private server<\/span><\/a><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p>&nbsp;<\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>SSH Key Authentication:<\/b><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">If you set up SSH key authentication, the SSH client will use your private key to authenticate the connection. You should have already added your public key to the VPS during its setup.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">If you are using Windows with <\/span><b>PuTTY<\/b><span style=\"font-weight: 400;\">, you will need to configure your private key in PuTTY&#8217;s settings. In the &#8220;<\/span><b>Session<\/b><span style=\"font-weight: 400;\">&#8221; window, under &#8220;<\/span><b>Connection <\/b><span style=\"font-weight: 400;\">&gt; <\/span><b>SSH <\/b><span style=\"font-weight: 400;\">&gt; <\/span><b>Auth<\/b><span style=\"font-weight: 400;\">,&#8221; browse and select your private key file (often with the <\/span><b>.ppk <\/b><span style=\"font-weight: 400;\">extension).<\/span><\/p>\n<p><span style=\"font-weight: 400;\">If you have not set up SSH keys yet, it is a good idea to do so for added security. You can generate an SSH key pair using <\/span><b>ssh-keygen <\/b><span style=\"font-weight: 400;\">(Linux\/macOS) or tools like <\/span><b>PuTTYgen <\/b><span style=\"font-weight: 400;\">(Windows).<\/span><\/p>\n<p><strong>Read more:\u00a0<a href=\"https:\/\/hostnoc-revamp.branex.org\/blog\/hdd-vs-ssd-dedicated-servers\/\">HDD Dedicated Servers Vs SSD Dedicated Servers: Which One You Should Choose and Why?<\/a><\/strong><\/p>\n<h3><span style=\"font-weight: 400;\">4. Verify Your Connection<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">Once logged in, you will see a command prompt showing the name of your virtual private server and other information like the <\/span><b>hostname<\/b><span style=\"font-weight: 400;\">. This indicates that you are connected successfully. From here, you can perform various administrative tasks on the virtual private server.<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">Troubleshooting SSH Connection Issues<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">If you are unable to connect, there are several common issues to check:<\/span><\/p>\n<h3><span style=\"font-weight: 400;\">Incorrect IP Address or Username:<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">Make sure you have entered the correct IP address for your virtual private server and the right username.<\/span><\/p>\n<h3><span style=\"font-weight: 400;\">Firewall Rules:<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">Ensure that your VPS firewall allows VPS Using SSH connections (<\/span><b>port 22 <\/b><span style=\"font-weight: 400;\">by default). If the firewall is blocking the connection, you will need to modify the rules. For example, in UFW (Uncomplicated Firewall) on Ubuntu, you can allow SSH with:<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><b>sudo ufw allow ssh<\/b><\/p>\n<h3><span style=\"font-weight: 400;\">SSH Service Not Running:<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">If SSH is not running on your virtual private server, you won\u2019t be able to connect. You can check and start the SSH service on your VPS by running this command:<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><\/p>\n<p><b>sudo systemctl start ssh<\/b><\/p>\n<h3><span style=\"font-weight: 400;\">SSH Port Blocked by ISP:<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">In rare cases, an internet service provider (ISP) may block certain ports like <\/span><b>port 22<\/b><span style=\"font-weight: 400;\">. In this case, you can configure SSH to run on a different port. Ensure you use the correct port when connecting.<\/span><\/p>\n<h3><span style=\"font-weight: 400;\">Permission Denied Error:<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">This is often a sign that you entered an incorrect password or do not have permission to log in as the user. Double-check your username and password or ensure your SSH key is properly added to the server.<\/span><\/p>\n<h3><span style=\"font-weight: 400;\">SSH Keys Configuration:<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">If you are using SSH keys, ensure that the public key has been correctly added to the <\/span><b>~\/.ssh\/authorized_keys<\/b><span style=\"font-weight: 400;\"> file of the user you are logging in as. The permissions of the <\/span><b>~\/.ssh directory <\/b><span style=\"font-weight: 400;\">and the <\/span><b>authorized_keys <\/b><span style=\"font-weight: 400;\">file should be set properly:<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><b>chmod 700 ~\/.ssh<\/b><\/p>\n<p><b>chmod 600 ~\/.ssh\/authorized_keys<\/b><\/p>\n<p><strong>Read more:\u00a0<a href=\"https:\/\/hostnoc-revamp.branex.org\/blog\/fix-filezilla-ftp-connection-timeout-error\/\">How To Fix Filezilla FTP Connection Timeout Error?<\/a><\/strong><\/p>\n<h3><span style=\"font-weight: 400;\">Server Overload or Misconfiguration:<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">If the server is under heavy load, the VPS Using SSH service may not respond properly. You can try to restart the server or check system logs for clues.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Use the following command to check if the SSH service is running:<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><\/p>\n<p><b>systemctl status ssh<\/b><\/p>\n<p><b>Securing SSH Access<\/b><\/p>\n<p><span style=\"font-weight: 400;\">Once you are connected to your virtual private server, it is important to ensure that your SSH access is secure.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Here are some best practices:<\/span><\/p>\n<h3><span style=\"font-weight: 400;\">Disable Password Authentication:<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">To enhance security, consider disabling password authentication and relying solely on SSH keys.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">To do this, open the SSH configuration file:<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><\/p>\n<p><b>sudo nano \/etc\/ssh\/sshd_config<\/b><\/p>\n<p><span style=\"font-weight: 400;\">Find the line <\/span><b>PasswordAuthentication yes<\/b><span style=\"font-weight: 400;\"> and change it to <\/span><b>PasswordAuthentication no<\/b><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Restart the SSH service to apply the change:<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><\/p>\n<p><b>sudo systemctl restart ssh<\/b><\/p>\n<p><strong>Read more:\u00a0<a href=\"https:\/\/hostnoc-revamp.branex.org\/blog\/install-openssl-on-windows\/\">How To Install OpenSSL On Windows?<\/a><\/strong><\/p>\n<h3><span style=\"font-weight: 400;\">Change the Default SSH Port:<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">For an added layer of security, consider changing the default VPS Using SSH port (22) to a random port. In the SSH configuration file (<\/span><b>\/etc\/ssh\/sshd_config<\/b><span style=\"font-weight: 400;\">), change the Port directive to a port number of your choice (e.g., <\/span><b>Port 2222<\/b><span style=\"font-weight: 400;\">). Remember to update your connection command accordingly.<\/span><\/p>\n<h3><span style=\"font-weight: 400;\">Use Fail2ban:<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">Fail2ban is a tool that helps protect against brute-force attacks by banning IPs after a set number of failed login attempts. Install it and configure it to protect your SSH access.<\/span><\/p>\n<h3><span style=\"font-weight: 400;\">Regularly Update Your System:<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">Always keep your virtual private server updated to protect against security vulnerabilities.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Run updates regularly:<\/span><\/p>\n<p><b>sudo apt update &amp;&amp; sudo apt upgrade<\/b><\/p>\n<h3><span style=\"font-weight: 400;\">Limit SSH Access with Firewall:<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">Use a firewall to limit SSH access to only specific IP addresses. This will prevent unauthorized users from attempting to connect.<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">Conclusion<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Connecting to your virtual private server via VPS Using SSH is a straightforward process once you have the correct credentials and tools in place. It is important to follow best practices to secure your connection, especially when using SSH keys instead of passwords and changing the default SSH port.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Regular <\/span><a href=\"https:\/\/hostnoc-revamp.branex.org\/blog\/server-monitoring\/\"><span style=\"font-weight: 400;\">server monitoring<\/span><\/a><span style=\"font-weight: 400;\"> of your virtual private server security and performance will ensure that your server remains secure and functional. By understanding the basic process and troubleshooting tips, you should be able to connect to your VPS with ease and manage your server effectively.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Did this article help you in connecting your virtual private server using a secure shell? Share it with us in the comments section below.<\/span><\/p>\n<p style=\"text-align: center;\"><strong><span class=\"highlight\" style=\"background-color:#971a1d;\">In the race for speed and control, shared hosting won\u2019t even qualify \u2014 VPS takes the win.<\/span>\n<\/strong><\/p>\n<p style=\"text-align: center;\"><section class=\"dedicated_plans_section plans-section\" id=\"dedicated_plan\">\n    <table id=\"data\" class=\"stackable large-only\">\n        <thead>\n            <tr>\n<!--                 <th class=\"tbl-head-plan\">Plan<\/th> -->\n                <th class=\"tbl-head-cores\">Cores<\/th>\n                <th class=\"tbl-head-ram\">RAM<\/th>\n                <th class=\"tbl-head-storage\">Storage<\/th>\n                <th class=\"tbl-head-plan\">Location<\/th>\n                <th class=\"tbl-head-location\">Monthly Price<\/th>\n                <th class=\"tbl-head-link\">Link<\/th>\n            <\/tr>\n        <\/thead>\n        <tbody>\n        <tr><td colspan=\"6\">No products found.<\/td><\/tr>        <\/tbody>\n    <\/table>\n<\/section>\n    <\/p>\n","protected":false},"excerpt":{"rendered":"<p>What You&#8217;ll Need Before You Connect? VPS Access Credentials: &nbsp; IP address: The IP address of your virtual private server. SSH Port: By default, SSH uses<span class=\"excerpt-hellip\"> [\u2026]<\/span><\/p>\n","protected":false},"author":13,"featured_media":12396,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"content-type":"","footnotes":""},"categories":[18],"tags":[],"class_list":["post-12381","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-vps-server"],"acf":[],"_links":{"self":[{"href":"https:\/\/hostnoc-revamp.branex.org\/blog\/wp-json\/wp\/v2\/posts\/12381","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hostnoc-revamp.branex.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hostnoc-revamp.branex.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hostnoc-revamp.branex.org\/blog\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/hostnoc-revamp.branex.org\/blog\/wp-json\/wp\/v2\/comments?post=12381"}],"version-history":[{"count":3,"href":"https:\/\/hostnoc-revamp.branex.org\/blog\/wp-json\/wp\/v2\/posts\/12381\/revisions"}],"predecessor-version":[{"id":12398,"href":"https:\/\/hostnoc-revamp.branex.org\/blog\/wp-json\/wp\/v2\/posts\/12381\/revisions\/12398"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hostnoc-revamp.branex.org\/blog\/wp-json\/wp\/v2\/media\/12396"}],"wp:attachment":[{"href":"https:\/\/hostnoc-revamp.branex.org\/blog\/wp-json\/wp\/v2\/media?parent=12381"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hostnoc-revamp.branex.org\/blog\/wp-json\/wp\/v2\/categories?post=12381"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hostnoc-revamp.branex.org\/blog\/wp-json\/wp\/v2\/tags?post=12381"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}