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

Example Analysis of SSH cracking Prevention in linux Server

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

Share

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

This article is to share with you the content of a sample analysis of SSH cracking prevention in linux servers. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

1. Linux server forbids IP from logging in to my server through SSH by configuring / etc/hosts.deny

Vim / etc/hosts.deny

2. Instead of using the default port 22 of the SSH service, reset a new port, preferably with a new port number greater than 1024

First, log in to the Aliyun console and open a new port on your server.

Then, modify the configuration file of SSH on the server, add a line of Port 1618 to the file, and save exit (: wq)

Vim / etc/ssh/sshd_config

The SSH service needs to be restarted after each change to the ssh service configuration

Service sshd restart

3. Do not give the other party a chance to crack it violently. Delete a common user such as admin, and the other party cannot guess the user name, so the password cannot be violently cracked (userdel-r means to delete completely without retaining the user's file information)

Userdel-r admin

4. Root users are prohibited from logging in through SSH, because the default super user name of the server is root, and the other party will have the opportunity to violently crack the password with the user name of root. If the password is cracked successfully, it can cause too much damage, especially in the production environment, so you can do this. Log in to SSH with other users, and if necessary, use su-switch back to the root user.

Vim / etc/ssh/sshd_config

Change the line PermitRootLogin yes to PermitRootLogin no

5. The password of the user who logs in to SSH is as complex as possible.

Thank you for reading! This is the end of this article on "sample Analysis of SSH cracking Prevention in linux Server". I hope the above content can be of some help to you, so that 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