Get the App
SLTechnology News&Howtos  ›  Servers  › 

Ssh secret-free login and matters needing attention

Shulou Source: shulou.com Published: 2022-06-03 02:15:08 09月22日 Update

Generate key pairs:

Ssh-keygen-t rsa just press enter all the time.

The files id_rsa (private key) and id_isa.pub (public key) are generated under the .ssh directory; by copying the contents of the public key to the .ssh file under the home directory of a user on the other machine, you can log in to the other host without password ssh. You need to establish the .ssh directory under the home directory of the other machine in advance and set permissions.

Mkdir .ssh & & chmod 700.ssh

You can also test the ssh secret-free login machine on this machine:

Cat. / id_rsa.pub > >. / authorized_keys & & chmod 644 authorized_keys

Ssh localhost

What is more important is that the permissions of the file must be set correctly, otherwise secret-free login will fail.

The .ssh directory should guarantee 700 permissions

The permissions of authorized_keys files should be guaranteed to be 644.

Tags: Directory file permission login other party public key machine local machine guarantee generate important two host content password key copy user test item Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno Shulou Tech Info Shulou Technology vpn Xiaomi