LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 02-14-2012, 06:31 AM   #1
sysmicuser
Member
 
Registered: Mar 2010
Posts: 353

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, 06:39 AM   #2
jhwilliams
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:
Quote:
HISTFILE
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
Code:
set +o history
in your ssh account's ~/.bashrc.

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

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, 07:04 AM   #4
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,513

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

Original Poster
Rep: Reputation: 0
Thanks Guys.
 
  


Reply


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 02:38 PM
Do shell scripts permit arithmetic operations? johnpaulodonnell Linux - Newbie 6 01-30-2007 10:24 AM
secure shell sunhui Linux - Software 3 08-17-2006 09:50 AM
remoste shell and secure shell suchi_s Programming 2 12-21-2004 06:31 AM
secure shell zepplin611 Linux - Software 5 03-03-2004 09:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:06 PM.

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