We often need to log on to the Unix/Linux System Using SSH, and use SCP to transmit data. We always need to enter a password. Isn't it annoying?
SSH supports multiple login authentication methods. The default mode is keyboard-interactive, that is, the one that manually enters the password. In practical applications, you sometimes need to log on to the SSH server without a password. For example, Mpi jobs need to use SCP to transmit data between WNs (non-interactive mode ). In this case, public key authentication is required and passphrase is set to be empty for password-free login.
Assume that you need to log on to host B (SSH server) from host a (client) without a password. The specific configuration is as follows:
1. HOST
* Cd ~ /. SSH
* Generate a public key file and a private key file. The types include DSA, RSA, and rsa1. (If you are sure, use either of them)
Ssh-keygen-T DSA
Ssh-keygen-T RSA
Ssh-keygen-T rsa1
* Cat *. Pub> authorized_keys_client
* SCP authorized_keys_client B :~ /. Ssh/
2. Host B
* Put the client's public key into the server's Trust List
Cd ~ /. SSH
Cat authorized_keys_client> authorized_keys
* Update permissions (important)
Chmod 0600 *
In this way, you do not need to enter the password to log on to host B from host a through SSH. Multiple users can repeat the preceding steps.
(Liu aigui/aiguille. Liu, 2008-03-28)