{"id":1936,"date":"2017-08-15T09:18:01","date_gmt":"2017-08-15T03:48:01","guid":{"rendered":"https:\/\/pheonixsolutions.com\/blog\/?p=1936"},"modified":"2026-09-08T11:42:46","modified_gmt":"2026-09-08T06:12:46","slug":"ssh-setup-newly-installed-ubuntu-16-04-2-server","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/ssh-setup-newly-installed-ubuntu-16-04-2-server\/","title":{"rendered":"SSH setup in a newly installed Ubuntu 16.04.2 server"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\">Introduction<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Secure Shell (SSH) is a protocol used to log in securely from a remote host to another system over an unsecured network. The password is encrypted when trying to log in to a remote host.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This guide explains how to set up SSH on a newly installed <strong>Ubuntu Server 16.04.2<\/strong> and connect to it from a host machine using the terminal.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>A newly installed Ubuntu Server 16.04.2.<\/li>\n\n\n\n<li>A host machine from which you are trying to access the remote machine.<\/li>\n\n\n\n<li>Sufficient privileges to install packages on the Ubuntu server.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Implementation<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In this scenario, we have a <strong>Mac OS X host<\/strong> from which we are trying to access a remote Ubuntu server through the terminal.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Perform an Update on the Server<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Run the following command to update the package information on the server:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">apt-get update<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Install OpenSSH Server<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Install the OpenSSH server package by running the following command:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo apt-get install openssh-server<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This installs the SSH server required to accept remote SSH connections.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3: Connect to the Ubuntu Server<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Open a terminal on the host machine and use the following command:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">ssh username@hostname<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You can also connect using the server&#8217;s IP address:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">ssh username@hostip<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For example:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">ssh serveradmin@192.168.x.x<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">A connection is now established to the Ubuntu Server.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Troubleshooting SSH Connection Issues<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If SSH is not installed or the SSH service is not running, you may receive an error when trying to connect to the server.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">ssh: connect to host hostname.tld port 22: Connection refused<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">When trying to check the SSH service using:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">service sshd status<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">you may receive:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Status: unrecognised service<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This indicates that the SSH service is not installed or is not available under the specified service name.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Following the above steps, you can install OpenSSH Server on a newly installed Ubuntu 16.04.2 server and establish a remote SSH connection from a host machine. The SSH connection allows you to securely manage the Ubuntu server remotely.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">FAQs<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1. What is SSH?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">SSH (Secure Shell) is a protocol used to securely access and manage a remote server over a network.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. How do I install SSH on Ubuntu?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Install the OpenSSH server using:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sudo apt-get install openssh-server<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">3. How do I connect to an Ubuntu server using SSH?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Use the following command:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">ssh username@hostip<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">4. What does \u201cConnection refused\u201d mean when using SSH?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">It generally indicates that the SSH service is not accepting connections on the specified port, which may occur if the SSH server is not installed or running.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">5. What is the default SSH port?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The default SSH port is <strong>22<\/strong>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">6. How can I check the SSH service?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">On Ubuntu, you can check the SSH service using:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">service ssh status<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Related Articles<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Install Jenkins on Ubuntu 16.<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Learn how to install and configure Jenkins on an Ubuntu 16 server for CI\/CD automation. <a href=\"https:\/\/pheonixsolutions.com\/blog\/install-jenkins-ubuntu-16\/?utm_source=chatgpt.com\" target=\"_blank\" rel=\"noreferrer noopener\">Read the Jenkins installation guide.<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Add Exim Service to Fail2Ban on Ubuntu<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Learn how to configure Fail2Ban to monitor Exim authentication logs and block repeated failed connection attempts. <a target=\"_blank\" rel=\"noreferrer noopener\" href=\"https:\/\/pheonixsolutions.com\/blog\/add-exim-service-fail2ban-ubuntu\/?utm_source=chatgpt.com\">Read the Exim and Fail2Ban guide<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Talk to our experts<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Looking for the right technology solution for your business? Our team of experts can help you with development, cloud, DevOps, design, and a wide range of other technology needs. Get in touch with our team&nbsp;<a href=\"https:\/\/pheonixsolutions.com\/contact\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction Secure Shell (SSH) is a protocol used to log in securely from a remote host to another system over [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1024],"tags":[319,274],"class_list":["post-1936","post","type-post","status-publish","format-standard","hentry","category-security","tag-ssh","tag-ubuntu","psol-cat-security"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/phn2x7-ve","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1936","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=1936"}],"version-history":[{"count":2,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1936\/revisions"}],"predecessor-version":[{"id":11528,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/1936\/revisions\/11528"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=1936"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=1936"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=1936"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}