There is nothing a hacker likes more than a tasty linux machine available on the Internet. In my recent Linux Foundation webinar I shared tactics, tools, and methods hackers use to invade your space.

In this blog series, we’ll cover the five easiest ways to keep hackers out and know if they have made it in. Want more information? Watch the free webinar on-demand .

Easy Linux Security Tip #1 If you are not using Secure Shell, you should be.

This has been a thing for a very, very long time. Telnet is insecure. rLogin is insecure. There are still services out there that require those services but they shouldn't be exposed to the Internet. If you don’t have SSH just turn off your Internet connection. As we always say: use SSH keys.

Rule No. 1 of SSH: Don't use password authentication. The second rule of SSH is: Don't use password authentication. This is really, really important.

If you have a Linux machine on the Internet for any period of time, you are going to get brute forced. It is just going to happen. The brute force is scripted. Scanners see port 22 open to the Internet and they have to hammer it hard.

The other thing you can do is you can move SSH off of the standard port which many of us do. That works to prevent a small number of brute force attacks but, in general, just don't use password authentication and you'll be safe.

The third rule of SSH is: All keys have passphrases. A no-passphrase key may as well not be a key at all. I realize that makes services hard to deal with if you are trying to log into something automatically or trying to automate stuff but all keys should have passphrases.

My favorite thing to do is to compromise a host and find home directories with private keys. As soon as I have private keys, it's game over. I can log into anything that the public key provides access to.

If you provide a passphrase or even a password, it doesn't have to be a long passphrase on your keys, then it makes my life much, much more difficult.

Easy Linux Security Tip #2 Install Fail2ban.

Those brute force attacks that I was talking about? This helps dramatically. It will automatically activate iptables rules to block repeated attempts to SSH into your machine. Be sure to configure it in such a way that it doesn't lock you out or doesn't take up too many resources. But use it, love it, and watch it.

It has its own logs so make sure to watch them and check to see if it’s actually functioning. That's a really important thing as well.

In part 2 of this series, I’ll give you three more easy security tips for keeping hackers out of your Linux machine. You can also watch the entire free webinar on-demand now.

Mike Guthrie works for the Department of Energy doing Red Team engagements and penetration testing.

本文系统(linux)相关术语:linux系统 鸟哥的linux私房菜 linux命令大全 linux操作系统

主题: Linux
分页:12
转载请注明
本文标题:How to Keep Hackers out of Your Linux Machine Part 1: Top Two Security Tips
本站链接:http://www.codesec.net/view/523032.html
分享请点击:


1.凡CodeSecTeam转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
登录后可拥有收藏文章、关注作者等权限...
技术大类 技术大类 | 系统(linux) | 评论(0) | 阅读(22)