1

It's okay that there are history files logging the commands that has been used. That't not the problem. The problem is that when 2 admins are logged in to an AIX server then it could be bad:

If admin #A uses

rm FILENAME 

then if admin #B hits the up arrow he gets the

rm FILENAME 

command which is not a very good thing. So how can the termial be forced to only write the command history if the ssh session ended? (UPDATE#2: or solution could be that that each session has it's uniq command history, and thus we can't see each others command, only when they sign out for ex.)

UPDATE#1

4:root@SERVER:/root # echo $SHELL /usr/bin/ksh 4:root@SERVER:/root # oslevel -s 6100-05-01-1016 4:root@SERVER:/root # 
4
  • Just for the record the behavior you are attributing to Linux is a bash feature other shells can behave differently. Commented Jun 4, 2012 at 0:36
  • I updated the question Commented Jun 12, 2012 at 5:32
  • which shell and version of shell are you using? Commented Jun 21, 2012 at 3:33
  • question updated, but there are machines with several oslevels Commented Jun 23, 2012 at 6:20

1 Answer 1

0

If your admin's use sudo, instead of just su'ing to root, they'll retain their own command history.

Alternatively, you can use ksh's HISTFILE variable to set the filename for the history. Add,

HISTFILE=~/.hist$$ 

to root's .profile. That'll generate a unique history file for every session, but you'll need some way to housekeep them.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.