Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Montior cmds on a tty/pty

Status
Not open for further replies.

visvid

Technical User
Jun 3, 2002
131
GB
Hi,

Is there away i can either monitor or output to a file the cmds someone is writing in from there tty /pty.

Problem is several of us have root access , and i sometimes need to see what commads my collegues have entered.

I did try following:

while
true
do
exec fc -l 1
sleep 60
done

but this is not sending me any output

also .sh_history is not showing me anything


Many thanks
 
What shell is root using? Usually this is /bin/sh which doesn't update .sh_history.

You could change root shell to /bin/ksh (or smiliar) but there are issues around this. Don't change the root shell without knowing exactly what you're doing!

Another option may be to create another super user (with a UID of 0) and set that users shell to /bin/ksh. That way, you could control the root account yourself, and the other users to do admin work as the other super user, with all commands logged. (Of course, they could always change .sh_history themselves!)

Greg.
 
Best way to control and monitor root access is with a package called "sudo".

With this you could still have a number of people allowed to work as root, but everything done as root would be logged. Sudo is a well established opensource product and I reccomend it.

There should be no problem with any individual objecting to the use of sudo, unless of course they are doing something that they do not want other people to know about.

Later on you, or your management, may well want to consider using sudo to restrict the types of work that can be done by specific individuals as the root user.
Mike
________________________________________________________________

"Experience is the comb that Nature gives us, after we are bald."

Is that a haiku?
I never could get the hang
of writing those things.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top