A is a local host (that is, the machine used to control other hosts); b is the remote host (that is, the controlled machine server), IP is 192.168.100.247; The systems A and B are all Linux commands on a.
# Ssh-keygen-T RSA (three consecutive returns, i.e. locally generated public and private keys, no password set) # SSH [email protected]192.168.100.247" mkdir. Ssh;chmod 0700. SSH" (requires a password, note: You must set the. SSH permission to A.) # SCP ~/.ssh/id_rsa.pub [email protected]:.ssh /id_rsa.pub (need to enter a password)
command on B:
# touch/root/.ssh/ ~/.ssh/authorized_keys (# Note: You must change the permissions of ~/.ssh/authorized_keys to 600, This file is used to save the public key generated by the SSH client and can modify the server'sSSH service-side configuration file/etc/ssh//root/.ssh/id_rsa.pub >>/root/.ssh/authorized _keys (Append id_rsa.pub content to Authorized_keys, be careful not to use >, otherwise it will empty the original content, so that others can not use the original key to log in)
Back to a machine:
# SSH [email protected]192.168.100.247 (no password required, login successful)
If you specify a different file name when generating the key pair (or if you need to control n machines, you will generate a multi-pair key), you need to specify the private key file with the parameter-I
# SSH [email protected]192.168.100.247 (no password required, login successful)
Linux SCP Remote replication command
SCP local_file [email protected]_ip:remote_folder such as SCP sample.zip [email protected] 192.168. 100.247 /usr/local
Password-free login is configured so that you do not need to enter the code when executing the SCP
Linux operating system-two Linux server ssh password-free login