Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there a way to see the commands that I entered in su mode? Similar to the ~/.bash_history? Where would this be located?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

actually it is in .bash_history. But when you su, you switch user, so you have to check .bash_history as the user you su'd to. When you su again, and type history, it will give you only the history from that user.

Eg. you changed to root, so using history as root again, or checking the root-homefolder (default is /root) for .bash_history will give you all previous commands.

share|improve this answer

In Debian you can define the variable SULOG_FILE in file /etc/login.defs as the log file for su activity.

You can test the contents of you login.defs, also man su can tell you if supported.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.