Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
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.
Someone has been logging in and issuing reboot commands. I am Running Redhat EL 5. Is it possible to find a log or start logging from which IP the reboot command came from or which user?
root pts/2 10.0.7.232 Wed Aug 11 02:43 still logged in
root pts/1 :0.0 Wed Aug 11 02:39 still logged in
root :0 Wed Aug 11 02:39 still logged in
reboot system boot 2.6.18-53.el5 Wed Aug 11 02:38 (00:05)
shailesh pts/1 10.0.7.234 Wed Aug 11 02:36 - down (00:00)
root tty1 Wed Aug 11 02:32 - down (00:04)
root pts/1 :0.0 Wed Aug 11 02:20 - 02:32 (00:11)
Thanks I tried that but here is what I get. Im not sure why it shows this way..It doesnt say who issued the reboot command unless I am missing something
root pts/1 1x.1x.4.x Tue Aug 10 00:17 - 04:18 (04:01)
root pts/1 1x.1x.4.x Tue Aug 10 00:09 - 00:10 (00:00)
root pts/1 1x.1x.4.x Tue Aug 10 00:00 - 00:02 (00:01)
root pts/1 1x.1x.4.x Mon Aug 9 23:55 - 23:58 (00:03)
root pts/1 1x.1x.4.x Mon Aug 9 23:52 - 23:54 (00:02)
root pts/0 1x.1x.4.x Mon Aug 9 23:49 - 00:22 (00:32)
reboot system boot 2.6.18-92.el5 Mon Aug 9 23:48 (11:59)
wxxx pts/4 1x.1x.4.x Mon Aug 9 15:39 - 15:43 (00:03)
Only super users (such as root) have privileges to reboot a system. The "last" command will only tell you when the command was issued by the pseudo user "reboot".
The only way to tell is to go through the ~/.bash_history of each user and check for any su or sudo commands to root with subsequent attempts to reboot.
This logic will obviously not apply if you are sharing the root password with anybody else. Also check for any cron jobs that are set up.
To sum it up, enforce the use of sudo.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.