1: Generate public key
2: Select the key type as rsa, the length as 2048, and click Next, as shown below:
The password here is to set a password for the key, so you also need to enter the password when using this key, or you can set it to empty
3: Save the key
(1): When you choose to enter a password
(2) No password is entered
4: Save and start connecting to the linux server
Use Xshell to log in to the server, go to the " /root/.ssh/ " directory, run the rz command (if there is no rz command, run yum install lrzsz to install),
1: Upload
[root@localhost ~] # cd /root/.ssh/ [root@localhost .ssh] # rz upload key file 2: Change the file name
[root@localhost .ssh] # cat me.pub >> authorized_keys me.pub ---" key file name
3: set permissions [root@localhost .ssh] # chmod 600 authorized_keys [root@localhost .ssh] # ls authorized_keys known_hosts me.pub [root@localhost .ssh]# cat authorized_keys ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA4VCOWFrARc1m3MfEAL50v2Z2siavO3Ijpr/LZ00EZah8EjfZhqjAc/agkljyXmNGpVDpRdtlYco8h3P5vegXOEgKcX74fDYm0vNdVABVD1XSD8ElNyLTCCNk7rZJbi3htJox3Q1n0vnMmB5d20d9occkAx4Ac94RWNS33EC5CszNTMgAIn+uZl0FlQklS1oSyWFahSTWyA6b33qG7Y5E4b6J/caObnPx6EgtBrgi97gXJHZWyYlGrpWmUuhPqs5XToRB08CVxAyzewtq1MXv0p+Po4L1pbHLRf+TSoZ5RSBZZjY4/JMAzdXHNtnAyO0j0VNGbBXKUcNSAHZ
5: Configure Xshell to log in to the server using key authentication:
get it