Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I was just checking some of my admin logs on my Redhat 9 server and I noticed that it looks like multiple people have been trying dictionary type attacks via ssh. It's kind of unnerving. I was wondering if anyone knows a way of stopping this?
1. If your regular customers log on from the same networks consistently, filter unwanted login attempts with netfilter and/or tcp_wrappers. Problem solved.
2. If your regular customers log on from the same machines consistently, enable pubkey authentication and disable all other authentication. Problem solved.
I recommend #1 or #2, or both.
3. If you can't do #1 or #2, move sshd to listen on a different port (e.g. 123). This is a sucky security measure, though, and will only stop the script kiddies.
4. If you can't do #1, #2, or #3, then make sure your users have strong passwords. You can enforce this with John or some such.
You might create a group for users who are authorized to use ssh, and use that group name in the /etc/ssh/sshd_conf configuration file. This should disallow all other users and groups. You may want to check the man sshd_conf manpages to double check. If you have the users in AllowUsers instead that would be fine also. AllowUsers trumps AllowGroups. If you want to use AllowGroups instead of AllowUsers, make sure that AllowUsers is commented out, because a user not listed AllowUsers will be denied access even if they are a member of a group in AllowGroups.
This is a suggestion for another layer of security rather than a replacement for the previous suggestions.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.