Skip to content

Ramblings and Thoughts

  • About

Ramblings and Thoughts

Networking, Computers, Life

Configuring SSH on Ubuntu

January 27, 2019 by chrisbog

Once you have installed an OpenSSH server,

sudo apt-get install openssh-server

you will need to configure it by editing the sshd_config file in the /etc/ssh directory.

sshd_config is the configuration file for the OpenSSH server. ssh_config is the configuration file for the OpenSSH client. Make sure not to get them mixed up.

First, make a backup of your sshd_config file by copying it to your home directory, or by making a read-only copy in /etc/ssh by doing:

sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.factory-defaults
 sudo chmod a-w /etc/ssh/sshd_config.factory-defaults

Creating a read-only backup in /etc/ssh means you’ll always be able to find a known-good configuration when you need it.

Once you’ve backed up your sshd_config file, you can make changes with any text editor, for example;

sudo gedit /etc/ssh/sshd_config

runs the standard text editor in Ubuntu 12.04 or more recent. For older versions replace “sudo” with “gksudo”. Once you’ve made your changes (see the suggestions in the rest of this page), you can apply them by saving the file then doing:

sudo restart ssh

If you get the error, “Unable to connect to Upstart”, restart ssh with the following:

sudo systemctl restart ssh

Configuring OpenSSH means striking a balance between security and ease-of-use. Ubuntu’s default configuration tries to be as secure as possible without making it impossible to use in common use cases. This page discusses some changes you can make, and how they affect the balance between security and ease-of-use. When reading each section, you should decide what balance is right for your specific situ

Post navigation

Previous Post:

How to Configure UBUNTU with a static IP Address

Next Post:

How to add the DNS Servers to Ubuntu

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Tags

Apache Carbon Copy Cloner Chrome Cisco Crashplan HTML iOS iClou Linux MySQL Nexus NXAPI Omnifocus OSX Outlook PyCharm Pytest Python Quicken Samsung TV Ubuntu VMWare Wordpress Youtube
© 2025 Ramblings and Thoughts | WordPress Theme by Superbthemes