First, configure Yum
Second, what is SSH
- The administrator can manage the multiple hosts scattered across the network by remote login.
- Administrators can do the following for remote hosts:
- Remote Login
- remote command execution
- Remote File transfer
- The sad thing is: these operations are unsafe!
- Use plaintext passwords and send them in clear text
- Information may be intercepted and passwords may be retrieved
- Unauthorized personnel using the intercepted password to log on to the system, causing damage to the system
SSH 's Goal
- Provide secure network services on unsecured networks.
Third, installation command
Yum install-y openssh-server openssh-clients
To start SSH:
Service sshd start or/etc/init.d/sshd start
To configure boot boot:
Chkconfig--level 2345 sshd on
Four, ssh password-free login
Ssh-keygen's command manual, through the "Man Ssh-keygen" command:
1. Generate Secret Keys
SSH-KEYGEN-T RSA
A ". SSH" folder will be generated at the user's root directory after the build
Entering ". SSH" will generate the following files
Authorized_keys: The public key that stores the remote password-free login, which records the public key of multiple machines mainly through this file.
ID_RSA: Generated private key file
Id_rsa.pub: Generated Public key file
Know_hosts: List of known host public keys
If you want the SSH public key to take effect, at least two of the following conditions will be met:
1). The SSH directory must have permissions of 700
2). The. ssh/authorized_keys file permission must be 600
2. Password-Free login method
2.1 By way of Ssh-copy-id
Command: Ssh-copy-id-i ~/.ssh/id_rsa.put [ip/hosts]
2.2 Writing content to each other's files via SCP
Command: scp-p ~/.ssh/id_rsa.pub [Email Protected]<remote_ip>:/root/.ssh/authorized_keys
V. Usage of SSH
1.SSH Login to another Linux
SSH [ip/hosts]
Sign Out:
Exit
2. Copying files
Grammar:
SCP the file name (relative or absolute path) to be copied to the ip:/path of the machine to be copied to
3. Copying folders
Grammar:
Scp–r folder [email protected]/hosts:/path
Linux installation ssh and SSH usage with password-free login