Skip to content

ssh-config | Cheatsheet


Publickey for Github

Host github.com gist.github.com
    User git
    Hostname github.com
    PreferredAuthentications publickey
    IdentityFile ~/.ssh/id_ed25519-2022-04-21

Publickey and Password

Host router
    user <user>
    Hostname 192.168.1.1
    IdentityFile ~/.ssh/id_rsa-2022-08-23
    KexAlgorithms +diffie-hellman-group1-sha1
    PreferredAuthentications publickey,password
  HostKeyAlgorithms ssh-ed25519-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-ed25519,ssh-rsa
  PubkeyAcceptedKeyTypes +ssh-rsa

Publickey

Host vps
    user <user>
    Hostname 192.168.1.1
    IdentityFile ~/.ssh/id_ed25519-2022-04-21
    KexAlgorithms +diffie-hellman-group1-sha1
    PreferredAuthentications publickey
  HostKeyAlgorithms ssh-ed25519-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-ed25519,ssh-rsa

Password

Host server
    user <user>
    Hostname 192.168.1.1
    PreferredAuthentications publickey,password
    KexAlgorithms +diffie-hellman-group1-sha1
    PreferredAuthentications assword
  HostKeyAlgorithms ssh-ed25519-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-ed25519,ssh-rsa