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 VPS modifies SSH login port and forbids ROOT login

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

Share

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

This article mainly introduces how VPS modifies the SSH login port and forbids ROOT login. The article is very detailed and has a certain reference value. Interested friends must read it!

Modify SSH login port

Modify the file: / etc/ssh/sshd_config

Port 22 # is on the third or fourth line. If there is a pound sign in front of it, please delete it and change it to less than 65534.

You can use the vi command in the remote connection, or sftp to download to the local modification, after modification, use the following command to restart the ssh service

/ etc/init.d/sshd restart#centos system, restart ssh service command

/ etc/init.d/ssh restart#debian/ubuntu system, restart ssh service command

Disable ROOT login

For a more secure setting, use a small login and then switch to ROOT (this method cannot upload files with SFTP)

Useradd yzgod# create a new secondary account

Passwd yzgod# sets the password for the secondary account. You need to enter exactly the same second time. Note the hint.

The file modified by vi / etc/ssh/sshd_config# is the same.

PermitRootLogin yes# changes yes to no, saves exit, and restarts the SSH service (with restart command)

Remember, if you don't create a new trumpet, or if you set the trumpet password incorrectly, and you disable ROOT, you can only restart the system or roll back the snapshot, and you'll never log in again.

If you don't desperately need a secure environment, and you need to use SFTP to manage files, just change the port.

The above is all the contents of the article "how VPS modifies SSH login port and forbids ROOT login". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

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