Operating System - Linux
1753580 Members
6118 Online
108796 Solutions
New Discussion юеВ

Re: log every keystorke of a user

 
SOLVED
Go to solution
njia_1
Trusted Contributor

log every keystorke of a user

Hi

Is there a way to log absolute every keystorke of a user ? for example, user root.

thanks
15 REPLIES 15
Alexander Chuzhoy
Honored Contributor
Solution

Re: log every keystorke of a user

what about `history` command?
You have the commands saved in .bash_history
inside home directory. I assume you use bash.
Steven E. Protter
Exalted Contributor

Re: log every keystorke of a user

shalom njia

HISTFILE=/root/.bash_history
HISTSIZE=5000
export HISTFILE HISTSIZE

Its standard in the bash shell. .bash_profile

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
njia_1
Trusted Contributor

Re: log every keystorke of a user

Hi

Thanks for your reply, history file does not do the job I want.

History files only has record of all the commands, what I want to do is to record all the keystorkes, including typing errors. The log will happen on both local and a remote log host. History files can be deleted and modified easily.

thanks
Joseph Loo
Honored Contributor

Re: log every keystorke of a user

hi,

if u got $$$, take a look at this:

http://www.symark.com/powerbroker.htm

else, another way is to use the script command which u define in the user's profile. "man script" for more detail.

regards.
(p.s. wat happen to the post u started on "interesting...")
what you do not see does not mean you should not believe
Steven E. Protter
Exalted Contributor

Re: log every keystorke of a user

Okay, you are going overboard.

The HISTFILE logs mistakes if enter is hit.

This level of monitoring, if applied to all users can impede performance. If only for root, the HISTFILE is a good enough tool.

Good Luck,

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Huc_1
Honored Contributor

Re: log every keystorke of a user

Hello Nija

If what you need is to log everything for someone you gave priv to "like root for install of a product/applic" you can ask then to use something like the following.

ssh 'hostname' | tee install_product.log

every modification will be in the install_product.log and if you keep an eye on the content of last and use command stat you will be able to figure out if the file has been edited/modified after log out.

Hope this is helps.

Jean-Pierre Huc
Smile I will feel the difference
Ivan Ferreira
Honored Contributor

Re: log every keystorke of a user

If you want to really log absolutly ALL keystrokes, you can use the script command.

You can also configure auditing, take in account that if you configure the HISTORY variables, root can easily modify that configurations.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Bill Thorsteinson
Honored Contributor

Re: log every keystorke of a user

There is a package which allows you to
snoop the tty. Highly invasive though.
Alan_152
Honored Contributor

Re: log every keystorke of a user

do a google for "linux keylogger"... lots of good ones are listed...