Skip to content

Instantly share code, notes, and snippets.

@tommypratama
Last active May 16, 2024 01:10
Show Gist options
  • Select an option

  • Save tommypratama/f96899f133ee885ed56f0aa1bf4e46d3 to your computer and use it in GitHub Desktop.

Select an option

Save tommypratama/f96899f133ee885ed56f0aa1bf4e46d3 to your computer and use it in GitHub Desktop.
Install SSH server on Ubuntu

Install SSH server on Ubuntu

  1. Update apt's package list from the repository sudo apt-get update

  2. Install openssh-server package. sudo apt-get install -y openssh-server

  3. ssh service should be started and enabled by default after installation. Check to confirm. sudo systemctl status ssh

  4. Start the ssh service if it's not already started. sudo systemctl start ssh

  5. You can disable ssh from running by default during system boot. sudo systemctl disable ssh

  6. To enable it back again, run the following command. sudo systemctl enable ssh

  7. Configure SSH server options by editing the configuration file using your favorite editor. sudo nano /etc/ssh/sshd_config

  8. SSH service will need to be restarted or reloaded for the changes to take effect. sudo systemctl restart ssh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment