Is SSH history local or its server side?

2

I use Putty to access my dedicated servers trough SSH. When i click up arrow couple times i can see commands that i put in yesterday or at previous session. Do they stay locally or on server side? How can i clear this list or previous commands? So next time if someone else logs in he won't see what i was doing.

Craig

Posted 2011-10-27T16:46:52.113

Reputation: 21

Answers

4

You can simply remove this file for now. And to prevent it being saved next time, you could put unset HISTFILE into your .bash_profile. A bit more drastic is ln -sf /dev/null .bash_history. You'll still have command history during your sessions, but the file isn't saved anymore.

ott--

Posted 2011-10-27T16:46:52.113

Reputation: 1 911

3

The history is kept in (most likely) a file in your home directory, ~/.bash_history, which is on the server you connect to. Other users shouldn't have access to your .bash_history, and you can just clear the content of that to clear out the history.

Rob

Posted 2011-10-27T16:46:52.113

Reputation: 2 152