SSH alias login


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

3. The server saves the public key
Local execution

cat .ssh/

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