linux_wiki:configure_key-based_authentication_for_ssh

Configure Key-based Authentication For SSH

General Information

SSH public/private key authentication for password-less logins.


Generate public/private key pair (press 'enter' when prompted to enter a passphrase to keep empty)

ssh-keygen
  • By default, uses type “rsa”
  • Private key in /home/<user>/.ssh/id_rsa
  • Public key in /home/<user>/.ssh/id_rsa.pub


Copy from server1 to destination server2

ssh-copy-id user@192.168.1.151


Execute Command on remote system (or simply ssh login normally)

ssh user@192.168.1.151 "ls -la"

  • linux_wiki/configure_key-based_authentication_for_ssh.txt
  • Last modified: 2019/05/25 23:50
  • (external edit)