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)

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

Copy from server1 to destination server2

ssh-copy-id user@

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

ssh user@ "ls -la"

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