There are two machines a and b. Now we need to add the user1 user of the machine to the user2 user trust list of the b machine, so that the user1 user of the machine can directly ssh to the user2 user of the b machine. Steps: 1. Enter a machine /home/user1/.ssh directory (if it is the root user, in /root/.ssh), if not, execute mkdir -p /home/user1/.ssh, check if there is an id_rsa.pub file in the directory. If not, execute the ssh-keygen -t rsa command, the file will be generated in the directory. Copy the contents of the file; 2. Enter the b machine /home/user2/.ssh directory, if not created, in the directory Execute vi authorized_keys, paste the contents copied in step 1 here in the last line, and then save and exit;
3, vi b /etc/hosts.allow of the machine, add a line: sshd: [here is a machine Ip, if it is two-way, remember to add two ip] and then execute in the user1 directory of a machine: ssh user2@b, successfully connected to the b machine. The ssh trust relationship refers to a user on a server trusting a user of the client, allowing the user to log in without entering a password. Another term is called public_key_auth. In fact, it is certificate trust. First, you need to create a certificate for the trusted user. Run the following command: ssh-keygen -t rsa will generate two files, id_rsa and id_rsa.pub, in the ~/.ssh directory, which are the private and public keys. Note that the id_rsa file must have a permissions of 600. Then, to the server user's ~/.ssh directory, create a file authorized_keys (if you already have it, edit it directly), and add the contents of id_rsa.pub (only one line of text) to the file and save it. Ok, so if you run ssh username@remotehost on the client, you can log in without entering the password. After setting up the trust relationship, you can download the remote file in the shell script or execute the command on the server without entering the password: ssh username@remotehost << EOF remote command... EOF sftp username@remotehost << EOF Get remotefile EOF
nmap is a network port scanner. Its main function is to check a group of target hosts to see which
Computer Store News: According to the latest report from a German technology website, Valves Steam B
Just as Hong Kong is still engaged in tug-of-war on the issue of electronic textbooks for bookseller
For Linux systems, whether it is a central processor, memory, disk drive, keyboard
Linux signal signal processing mechanism
The 20 advantages of Linux and Windows
Arm linux boot process into the kernel
Linux often crashes, stuck, what should I do?
Data transfer on the link layer of the linux protocol stack -sk
Analysis of PCB software tools under Linux
Solution to common problems under Linux system
Desktop Linux Standards Learned Windows Compatible
Arista Networks is a little different
The device is currently in use
Linux-Windows "two-in-one" computer debuted at
Using the flock command on Linux to control the asynchronous execution of programs
Win7 computer boot prompts to start repair can not enter the system how to do?
How to experience the full function? Detailed explanation of Win8 activation method
Win10 taskbar thumbnail is too small folder does not display thumbnails What should I do?
Win7 system to view the details of all the volume labels in the computer on the command line
Win 7 system Foxit PDF IFilter plug-in quickly search for massive PDF
The Win8 navigation pane prohibits the display of favorites. Step
How to deal with Win8.1 notebook directly when charging 15%?
Win10 upgrade assistant click login, no response, can't log in, what should I do?