Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use SSH for remote connection in centos system

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail how to use SSH to connect remotely in the centos system. The content of the article is of high quality, so the editor shares it for you as a reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.

1.

① views the sshd service through the ls-l / etc/init.d/sshd command

② views the sshd process through the ps-ef | grep sshd command

The difference between 2.ssh_config and sshd_config: one represents the local client and the other represents the server:

3. View the sshd configuration file through the ll / etc/ssh/sshd_config command:

4. Before modifying the configuration file, the backup is named in the format of hostname, time and date, where / etc/ssh/sshd_config is backed up as / etc/ssh/sshd_config.you.20160222

5. Set the line number by entering the: set nu command in vi command mode:

6. Modify the configuration file as follows:

a. Change the yes of useDNS to no:

b. Translate the listening address from 0.0.0.0 to the private network IP address 192.168.65.130:

After modifying the listening address, it is found that the sshd service only accepts or treats the private network 192.168.65.130 as a legitimate ip:

c. Change the yes that forbids root remote connections to no:

d. Search GSSAuthentication to change the default yes comment to no:

f. Modify the port number to change the original remote connection port 22 to 52113:

7. Batch implementation of sshd configuration changes:

a. Paste the entire configuration that needs to be modified directly into / etc/ssh/sshd_config (seems to deny that the level no is more advanced?)

b. Batch modification through the sed command: sed-ir'13 iport 52113\ nPermitRootLogin no\ nPermitEmptyPasswds no\ nUseDNS no\ nGSSAPIAuthentication no' sshd_config

On how to use SSH remote connection in the centos system to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report