Forum Moderators: bakedjake
My question right now is:
I had to recompile apache. Now my root login notification that was setup in bash_profile is gone. I used the info below from another site to set this up. Does recompiling apache delete the bash_profile all the time or did I do something wrong? Thanks!
Install a root breach DETECTOR and EMAIL WARNING
=========================================
If someone does happen to get root, be warned quickly by installing a detector and warning at your box. You will at least get the hackers/spammers ip address and be warned someone is in there.
Server e-mail everytime someone logs in as root
To have the server e-mail you everytime someone logs in as root, SSH into server and login as root.
At command prompt type:
pico .bash_profile
Scroll down to the end of the file and add the following line:
echo 'ALERT - Root Shell Access on:' `date` `who` ¦ mail -s "Alert: Root Access from `who ¦ awk '{print $6}'`" your@email.com
Save and exit.
2. It's highly unlikely building or installing Apache did anything to your login script.
3. Cpanel, on the other hand, has among it's functions the ability to manage (create, delete) user accounts. I don't use CPanel (I use DirectAdmin) so I don't know the details. Did you add your user account to CPanel? If so, you can expect that it wrote what IT wants to write in the user's home directory.
That's one of the drawbacks of using a control panel - they often take real control away from you, and insist on doing things "their way".
I didn't know I shouldn't be logged in as root when recompiling apache. I really must find a good book or manual on this stuff. I confess I am a nerd and really love this stuff but also very naive about 'nix stuff.
Maybe it is just me, but I find cpanel kind of kludgey(sp?) and buggy. I will look into switching to directadmin. Thanks,
I didn't know I shouldn't be logged in as root when recompiling apache.
When you are logged-in as root, you have access to ALL files. You shouldn't be routinely logged-in as root - it's an extreme security risk.
It's best to always log-in as a normal user, and escalate your privileges as needed, using "su", "sudo", etc.
It's especially easy to avoid logging-in as root on a Linux GUI system, BTW - long before Vista, Linux desktop system configuration and management apps have permitted escalated privileges from a user account. (You are promoted for the root password.)
If you are doing something (such as compiling, editing files under your home directory, etc. etc.) that doesn't require root privileges, don't do it as root.
Maybe it is just me, but I find cpanel kind of kludgey(sp?) and buggy. I will look into switching to directadmin.
Uh, that's pretty close to my opinion of DirectAdmin, as well. I use it, reluctantly, because I get better support from my host if I use it. But I've had to learn how to work-around it's limitations. For example, I have to remember never to perform certain operations, so that it doesn't clobber my manually-edited Apache config files. (They give you the ability to add arbitrary options to certain sections of the config through the control panel, but not all.)