1846201 Members
4371 Online
110255 Solutions
New Discussion

Sudo log

 
johnreid
Contributor

Sudo log

Hi Gurus ,

I am accessing my application using sudo account , I came to know that all the commands run by me are stored is it so , how to see it and if I want to remove how to remove it.

3 REPLIES 3
Bill Hassell
Honored Contributor

Re: Sudo log

sudo is not an account, it is a program that temporarily gives you root privileges. Normally, you would never run a shell with sudo but instead run a single command. If you run a shell, then the commands would be logged into the .sh_history file but sudo did not login like a normal user. Therefore there is no history file, another reason not to allow a shell as part of the sudoers list of commands.


Bill Hassell, sysadmin
Muthyala
Frequent Advisor

Re: Sudo log

Hi

The history files are stored under .sh_history file or directory under your home directory or under the home directory of user you are trying to SU.

Thanks
Sri
Rick Garland
Honored Contributor

Re: Sudo log

The sudo log will log those commands that you invoke with sudo. If you run commands without 1st calling sudo then they will not be in the sudo log. If you have the HIST set up then they would be in the accounts '.sh_history' file.

If you are wanting to remove some info from the sudo log, you are compromising the integrity of any security features you may have setup. Also, it should be setup so that only root can edit the sudo log file.