Skip to content
Snell Rojas

Programming

How to SSH into Ubuntu Desktop

Turn your old laptop or PC into a Linux server: install OpenSSH on Ubuntu Desktop, create a key pair, copy it over and connect over SSH.

Snell RojasPublished Updated 1 min read

I wrote this post in Spanish in 2022 and adapted it to English in 2026.

This short tutorial will help you turn your old laptop or PC into your new Linux server, where you can run Docker with your different apps.

On the Desktop #

Install openssh-server:

bash
$ sudo apt install openssh-server

Allow SSH connections:

bash
$ sudo ufw allow ssh

With that, everything is ready on the machine we're going to connect to.

On Your Device #

Create a public/private key pair:

bash
$ ssh-keygen -b 4096

Give the key a name and a passphrase. You can just press Enter if you don't want an extra passphrase.

Now it's time to copy the public key to the machine you want to connect to:

bash
$ ssh-copy-id -i ~/.ssh/your-key.pub user@machine-ip

Remember to replace:

  • your-key: with the name of the key you created
  • user: with the user you log in to the PC with
  • machine-ip: with your device's IP address

To get your device's IP address:

bash
$ ip a

Now, with the key copied, all that's left is to connect over SSH:

bash
$ ssh user@machine-ip