SSH alias login

Time:2020-6-30

1. Modify the configuration and open the key login
vim /etc/ssh/sshd_ Config, modify the configuration item as follows.

RSAAuthentication yes
PubkeyAuthentication yes

AuthorizedKeysFile      .ssh/authorized_keys

2. Local key generation

ssh-keygen -t rsa

Executing the above command will generate the key file in ~ /. SSH directory

  • id_rsa
  • id_rsa.pub

3. The server saves the public key
Local execution

cat .ssh/id_rsa.pub

Copy it
Enter the server and create authorized in ~ /. SSH directory_ Keys file (if it already exists, you don’t need to create it), and paste the content just copied into it

This allows you to log on to the server locally without a password

ssh 192.168.10.10