Servers and cloud

Give servers short names (SSH config file)

Type ssh myserver instead of the full user, address and key every time.

Fill these in once
  1. Add a short name for the server
    Terminal
    cat >> ~/.ssh/config <<'EOF'
    Host myserver
      HostName 203.0.113.10
      User ubuntu
      IdentityFile ~/.ssh/id_ed25519
    EOF
  2. Connect with just the short name
    Terminal
    ssh myserver

    The short name works for scp and rsync too, in place of user@address.

  1. Add a short name for the server
    Terminal · Ubuntu / Debian
    cat >> ~/.ssh/config <<'EOF'
    Host myserver
      HostName 203.0.113.10
      User ubuntu
      IdentityFile ~/.ssh/id_ed25519
    EOF
  2. Connect with just the short name
    Terminal · Ubuntu / Debian
    ssh myserver

    The short name works for scp and rsync too, in place of user@address.

  1. Add a short name for the server
    PowerShell
    Add-Content "$env:USERPROFILE\.ssh\config" @"
    Host myserver
      HostName 203.0.113.10
      User ubuntu
      IdentityFile ~/.ssh/id_ed25519
    "@
  2. Connect with just the short name
    PowerShell
    ssh myserver