Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 02-14-2012, 07:31 AM   #1
Registered: Mar 2010
Posts: 364

Rep: Reputation: 0
Secure shell operations

Hi Guys,

I want ask one question.

Normally when you login to shell(unix bash shell) or whichever shell , all commands you run are recorded in ".bash_history" file.

Now we have a service account which is shared among the users, it is possible that when I login to shell , requesting shell to not to record/remember my command/operations?

Please assist here.

Thank you.
Old 02-14-2012, 07:39 AM   #2
Senior Member
Registered: Apr 2007
Location: Portland, OR
Distribution: Debian, Android, LFS
Posts: 1,168

Rep: Reputation: 210Reputation: 210Reputation: 210
You could accomplish this by arranging for HISTFILE to be unset when the user logs in:

From the Bash man page:
The name of the file in which command history is saved (see HISTORY below). The
default value is ~/.bash_history. If unset, the command history is not saved when an
interactive shell exits.
Alternately, you could set HISTFILE=/dev/null in ~/.ssh/environment, after ensuring PermitUserEnvironment is set in /etc/ssh/sshd_config.

Yet another option is to add
set +o history
in your ssh account's ~/.bashrc.

Last edited by jhwilliams; 02-14-2012 at 07:42 AM.
1 members found this post helpful.
Old 02-14-2012, 07:57 AM   #3
Registered: Mar 2010
Posts: 364

Original Poster
Rep: Reputation: 0
Thank you! Issue is resolved , this is what I was looking for.
set +o history does the trick.

Your earlier solution is pretty good effective but that may not be preference of each individual.

bash still remembers set +o history ! but that is Ok.
Old 02-14-2012, 08:04 AM   #4
LQ Guru
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,579

Rep: Reputation: 2914Reputation: 2914Reputation: 2914Reputation: 2914Reputation: 2914Reputation: 2914Reputation: 2914Reputation: 2914Reputation: 2914Reputation: 2914Reputation: 2914
I find the best way is to set .bash_history as a symbolic link to /dev/null
Old 02-16-2012, 07:08 AM   #5
Registered: Mar 2010
Posts: 364

Original Poster
Rep: Reputation: 0
Thanks Guys.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Secure Shell in website sandeshsk007 Linux - Software 2 02-12-2008 03:38 PM
Do shell scripts permit arithmetic operations? johnpaulodonnell Linux - Newbie 6 01-30-2007 11:24 AM
secure shell sunhui Linux - Software 3 08-17-2006 10:50 AM
remoste shell and secure shell suchi_s Programming 2 12-21-2004 07:31 AM
secure shell zepplin611 Linux - Software 5 03-03-2004 10:46 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:12 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration