OpenSSH Step-by-Step Tutorial

Learn the essential skills of connecting to a remote server using SSH. In this tutorial I will guide you through the entire process, covering SSH password authentication, key-based authentication, and connecting to a non-default port.

Quick reference: common SSH commands

These are the standard OpenSSH commands for the topics covered in the video. The video may use slightly different options (for example, a different key type), so follow the video if anything differs. Replace user, server and the file names with your own.

  • Connect with a password: ssh user@server
  • Create a key pair: ssh-keygen -t ed25519
  • Copy your public key to the server: ssh-copy-id user@server
  • Connect with a specific private key: ssh -i ~/.ssh/id_ed25519 user@server
  • Connect on a non-default port (for example 2222): ssh -p 2222 user@server

Related guides: Enable SSH password authentication, Configure MFA for SSH and Recover an instance with a lost SSH key.