Check if anyone is hacking your linux

Being “hacked” is something that most computer users and network administrators fear. It can mean losing private data that the hacker can use to steal your identity, or the hacker using your computer as a conduit for his own illegal activities. While Linux users can usually keep their systems safe from being compromised by installing software only from sources they trust, one backdoor that Linux users have a harder time preventing hackers from using is “SSHing” into their computer. Luckily, there is an easy way to see if anyone has been trying to hack your Linux machine this way.

Instructions

Open a terminal emulator on your system. Click the main menu (in the upper left-hand corner if you use GNOME, lower left if you use KDE), then click on the “Terminal” icon inside the “Accessories” sub-menu if you use GNOME or the “Utilities” sub-menu if you use KDE.

Type “cd /var/log” into the terminal window. This will bring you to the folder in which Linux stores records of failed attempts to log into your computer.

Type “grep sshd /var/log/auth.log | less” into the terminal. This command will display the dates and times when sometime tried to remotely log into your computer over the Internet through SSH. If these are times in which you were not trying to log into your own computer, or times in which an authorized user was trying to access her own accounts, then it means that someone has been trying to hack your Linux machine.

Share — copy and redistribute the material in any medium or format
Adapt — remix, transform, and build upon the material
for any purpose, even commercially.

The licensor cannot revoke these freedoms as long as you follow the license terms.

Under the following terms:

Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.

ShareAlike — If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.

No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.