SSH
Setup SSH authentication on a Linux server from Linux/Windows
Generate SSH Keys
ssh-keygenCopy Public Key to Remote Linux Host
From Linux:
ssh-copy-id <user>@<hostname> # -p <port-number> (optional)cat ~/.ssh/id_rsa.pub | ssh <user>@<hostname> 'umask 0077; mkdir -p .ssh; cat >> .ssh/authorized_keys && echo "Key copied"'From Windows:
type $env:USERPROFILE\.ssh\id_rsa.pub | ssh <hostname> "cat >> .ssh/authorized_keys"(Optional) SSH Config
Host MyServer
HostName <hostname>
User <user>
IdentityFile ~/.ssh/id_rsa
Host blabla
HostName <hostname>
User <user>
IdentityFile ~/.ssh/id_rsa_blablaLast updated