{"id":831,"date":"2017-11-08T13:00:52","date_gmt":"2017-11-08T13:00:52","guid":{"rendered":"http:\/\/chewett.co.uk\/blog\/?p=831"},"modified":"2017-11-05T21:53:00","modified_gmt":"2017-11-05T21:53:00","slug":"enabling-ssh-ubuntu-16-04","status":"publish","type":"post","link":"https:\/\/chewett.co.uk\/blog\/831\/enabling-ssh-ubuntu-16-04\/","title":{"rendered":"Enabling SSH on Ubuntu 16.04"},"content":{"rendered":"<p>By default you are not able to SSH into an Ubuntu 16.04\u00a0 machine and this blog post describes the steps needed to install SSH server.<\/p>\n<p><!--more--><\/p>\n<h2>Installing OpenSSH Server<\/h2>\n<p>To enable logging in from another computer via SSH you need to install a SSH\u00a0server. To do this you\u00a0can run the following command. This will\u00a0install the OpenSSH\u00a0server for Ubuntu.<\/p>\n<pre>sudo apt-get install openssh-server<\/pre>\n<p>Once this has installed the OpenSSH server will have been configured and started. At this point you can start using SSH on the machine. By default this will be configured for the default port (22) and will be started each time the machine starts.<\/p>\n<h2>Configuring SSH via the config file<\/h2>\n<p>The SSH server can be configured by editing its configuration file located at:<\/p>\n<pre>\/etc\/ssh\/sshd_config<\/pre>\n<p>One of the ways you can improve the security of your server is changing the port SSH runs on. This can be changed by setting the <code>Port<\/code>\u00a0setting. If you are changing this it is recommended to set it to a random unusued\u00a0port above 1024. Doing this doesn&#8217;t\u00a0limit who can access it or provide any inherent security. However most hacking\/scanning attempts will automatically try the default port and not try any others.<\/p>\n<p>Another improvement you can make is by disabling SSH via password login. This can be changed with the following SSHD config.<\/p>\n<pre>PasswordAuthentication no<\/pre>\n<p>Setting <code>PasswordAuthentication<\/code> to no would only allow login via private key and other more secure authentication methods. It is recommended to only set this up if you have created a private key and verified it works.<\/p>\n<p>Once this has been modified you will need to restart the SSH server for changes to be applied.<\/p>\n<h2>How to restart the OpenSSH Server<\/h2>\n<p>Any time the configuration server has been modified you will need to restart the SSH server to reload the configuration.\u00a0 This can easily be done by running the following command.<\/p>\n<pre>sudo systemctl\u00a0restart sshd<\/pre>\n<p>Once this has been done any changes to the configuration file will be loaded and applied.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>By default you are not able to SSH into an Ubuntu 16.04\u00a0 machine and this blog post describes the steps needed to install SSH server.<\/p>\n","protected":false},"author":1,"featured_media":837,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"jetpack_post_was_ever_published":false,"_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":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[5],"tags":[39,90,147,189],"class_list":["post-831","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-informational","tag-linux","tag-ssh","tag-ubuntu","tag-ubuntu-16-04"],"wppr_data":{"cwp_meta_box_check":"No"},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/11\/enable_ssh_on_ubuntu.jpg?fit=800%2C800&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p2toWX-dp","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":1698,"url":"https:\/\/chewett.co.uk\/blog\/1698\/enabling-ssh-on-ubuntu-18-04\/","url_meta":{"origin":831,"position":0},"title":"Enabling SSH on Ubuntu 18.04","author":"Chewett","date":"November 14, 2018","format":false,"excerpt":"By default Ubuntu 18.04 doesn't enable SSH, this post describes the steps you need to set up SSH. Enabling SSH on Ubuntu 18.04 Since many people will not require a SSH daemon on their computer this is not enabled by default. This means if you want to SSH into your\u2026","rel":"","context":"In &quot;Informational&quot;","block_context":{"text":"Informational","link":"https:\/\/chewett.co.uk\/blog\/category\/informational\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/10\/enabling_ssh_ubuntu.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/10\/enabling_ssh_ubuntu.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/10\/enabling_ssh_ubuntu.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2018\/10\/enabling_ssh_ubuntu.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":2535,"url":"https:\/\/chewett.co.uk\/blog\/2535\/fixing-ssh-keygen-unknown-option-g-or-t-on-ubuntu-20-04\/","url_meta":{"origin":831,"position":1},"title":"Fixing ssh-keygen Unknown Option -G or -T on Ubuntu 20.04","author":"Chewett","date":"July 4, 2020","format":false,"excerpt":"This blog post talks about how you can resolve the problem \"ssh-keygen Unknown Option -G\" on Ubuntu 20.04. What is ssh-keygen -G and -T used for? The command ssh-keygen -G was originally used to generate a list of prime numbers that could be used for key exchange. Typically the list\u2026","rel":"","context":"In &quot;Fixes&quot;","block_context":{"text":"Fixes","link":"https:\/\/chewett.co.uk\/blog\/category\/fixes\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/07\/sshkeygen_ubuntu2004-1.jpg?fit=1200%2C628&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/07\/sshkeygen_ubuntu2004-1.jpg?fit=1200%2C628&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/07\/sshkeygen_ubuntu2004-1.jpg?fit=1200%2C628&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/07\/sshkeygen_ubuntu2004-1.jpg?fit=1200%2C628&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/07\/sshkeygen_ubuntu2004-1.jpg?fit=1200%2C628&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":2610,"url":"https:\/\/chewett.co.uk\/blog\/2610\/using-virtualbox-shared-folder-on-ubuntu-20-04\/","url_meta":{"origin":831,"position":2},"title":"Using Virtualbox Shared Folder on Ubuntu 20.04","author":"Chewett","date":"September 12, 2020","format":false,"excerpt":"This post explains how you can configure Virtualbox Shared Folders for Ubuntu 20.04. Installing Virtualbox Guest Additions Before you can configure Virtualbox Shared folders you will need to install Virtualbox Guest Additions. I have detailed the process of installing this on another blogpost which you should first follow. Once done\u2026","rel":"","context":"In &quot;Informational&quot;","block_context":{"text":"Informational","link":"https:\/\/chewett.co.uk\/blog\/category\/informational\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/08\/virtualbox_shared_folder_ubuntu_2004_posticon_OUTPUT.png?fit=1200%2C628&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/08\/virtualbox_shared_folder_ubuntu_2004_posticon_OUTPUT.png?fit=1200%2C628&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/08\/virtualbox_shared_folder_ubuntu_2004_posticon_OUTPUT.png?fit=1200%2C628&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/08\/virtualbox_shared_folder_ubuntu_2004_posticon_OUTPUT.png?fit=1200%2C628&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/08\/virtualbox_shared_folder_ubuntu_2004_posticon_OUTPUT.png?fit=1200%2C628&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":345,"url":"https:\/\/chewett.co.uk\/blog\/345\/ssh-access-passwordless-keyfile\/","url_meta":{"origin":831,"position":3},"title":"SSH access with passwordless keyfile","author":"Chewett","date":"May 27, 2017","format":false,"excerpt":"I want to be able to access my Raspberry Pi Cluster and log onto any node without entering a password. To do this I can set up as passwordless SSH key. Generating a SSH Key To generate a SSH key you can use the command ssh-keygen. Once you have ran\u2026","rel":"","context":"In &quot;Raspberry Pi Cluster&quot;","block_context":{"text":"Raspberry Pi Cluster","link":"https:\/\/chewett.co.uk\/blog\/category\/raspberry-pi-cluster\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":103,"url":"https:\/\/chewett.co.uk\/blog\/103\/irc-client-on-raspberry-pi-screen-and-irssi\/","url_meta":{"origin":831,"position":4},"title":"IRC client on Raspberry Pi &#8211; Screen and irssi","author":"Chewett","date":"February 20, 2013","format":false,"excerpt":"A IRC client lets you connect to\u00a0a IRC server enabling you to join chatrooms on that server. IRC servers do not by default store logs while you are not logged in. This can be annoying if you wish to keep informed of whats going in on the chatroom. One solution\u2026","rel":"","context":"In &quot;Software&quot;","block_context":{"text":"Software","link":"https:\/\/chewett.co.uk\/blog\/category\/software\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":407,"url":"https:\/\/chewett.co.uk\/blog\/407\/ssh-connect-host-raspberrypi-port-22-connection-refused-error-fixed\/","url_meta":{"origin":831,"position":5},"title":"ssh: connect to host raspberrypi port 22: Connection refused Error Fixed","author":"Chewett","date":"June 24, 2017","format":false,"excerpt":"I was setting up a new install of Raspbian Pixel and found I couldn't login to the Raspberry Pi. It was giving me an error: chewett@bunker-master:~$ ssh pi@raspberrypi ssh: connect to host raspberrypi port 22: Connection refused It turns out that recently the Raspberry Pi Foundation have changed the default\u2026","rel":"","context":"In &quot;Raspberry Pi Cluster&quot;","block_context":{"text":"Raspberry Pi Cluster","link":"https:\/\/chewett.co.uk\/blog\/category\/raspberry-pi-cluster\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts\/831","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=831"}],"version-history":[{"count":7,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts\/831\/revisions"}],"predecessor-version":[{"id":839,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts\/831\/revisions\/839"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/media\/837"}],"wp:attachment":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=831"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=831"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=831"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}