In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-06-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
First of all, let's talk about the general idea:
1. Log in to the CentOS system with password
two。 Configure ssh
3. Xshell generates the secret key
4. Make a secret-free landing.
Software, equipment:
CentOS7.5 (Baidu CVM)
Next, let's get down to business:
1. Password remote connection CentOS
Open xshell-File-New, and the interface shown below will pop up
Explain what needs to be changed in it.
Name: in order to distinguish the server, name the protocol: default ssh: host: IP address port of the machine where the CentOS system is located: 22 by default: you can reconnect if necessary. When the connection is accidentally disconnected, xshell will reconnect automatically.
Select from the directory on the left to display the following interface
Parameter description:
Method: the authentication method when xshell connects with CentOS. Select the Password user name: CentOS user name for the first time. I directly use the root account password here: the password of the login account is required.
Then connect, and a successful login will display your login user name in front of the command line, as shown in the following figure
If the login fails, first check whether the login account exists and the password is correct. If there is no problem, check whether the port of CentOS is open.
two。 Install and configure ssh
1. Install openssh-server
Yum install-y openssl openssh-server
two。 Modify ssh configuration
Open / etc/ssh/sshd-config using vim
Sudo vim / etc/ssh/sshd_config
After editing, save it
3. Start the ssh service
Systemctl start sshd.service
4. Set ssh to boot automatically
Systemctl enable sshd.service
5. Create a .ssh folder
Create a .ssh folder in the user's home directory
Mkdir / .ssh
So far, ssh configuration has come to an end.
3. Xshell generates the secret key
1. Open xshell-tools-user key Manager
The following window pops up
Select build in the right option row
Select the next step and no modification is required
The key has been generated. Click next.
Parameter description
Key name: if you start at will, you can tell the password clearly: this is the password to verify our identity, which will be encrypted through RSA. Here I use 123456 confirmation: the password is the same as the password above, and the purpose is to test whether our passwords are the same.
Then choose to save the file and save the public key information. Here I save it as test.pub, and click finish after saving (xshell will automatically record the test. Pub)
Then upload test.pub to the .ssh folder we created in step 2
First cd ~ / .ssh enters the .ssh folder, and then executes rz, which will pop up a window to select the file and select the test.pub that has just been generated
Then use ll to check whether the upload is successful
Cat test.pub > > authorized_keys
4. Configure secret-free login on xshell
Create a new connection with the same setting name, host, port and other information. Note that the name should be set to different, so that it can be easily distinguished.
Set up user authentication
Parameter description:
Method: select the Public key user name: the user who created the .ssh folder. Here is the root account, so the user name is the root user key: in the drop-down box, select the test (that is, the test.pub you just created) password: the password you entered when generating the key
Summary
The above is the detailed explanation of the idea of xshell remote login CentOS7 secret-free login introduced to you by the editor. I hope it will be helpful to you. If you have any questions, please leave a message for me, and the editor will reply you in time. Thank you very much for your support to the website!
If you think this article is helpful to you, you are welcome to reprint it, please indicate the source, thank you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.