Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am ssh'ing into a remote server and then su'ing to root.

The problem is that sometimes, I have not paid enough attention to the console message, and I have accidentally typed in the root password at the command prompt (when for example, I had failed to provide the root password correctly the first time - so su prompt went away).

I remember reading somewhere that a history of commands typed at the console is kept somewhere.

I have 3 sub questions

  1. Where (which folder) is the file stored?
  2. Can I edit that file and remove the root password from it?
  3. Being the paranoid person that I am, I wonder if there is a more secure way of logging into my server - other than ssh (or am I being TOO paranoid?)

My server is running a headless Ubuntu 10.0.4

share|improve this question
up vote 1 down vote accepted

If you are using bash, the history is in ~/.bash_history, yes, you can edit it.

But there's nothing that will prevent you from entering your password in the wrong place, short of paying attention.

share|improve this answer

Your Answer


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.