We help IT Professionals succeed at work.

Is it possible to know who is loging on from where?

xzhang
xzhang asked
on
Medium Priority
264 Views
Last Modified: 2013-12-06
Hi, I wonder if we can know from where a certain user
log into my machine. Is this infomation in lastlog,
utmp and wtmp?
Thanks.


Comment
Watch Question

Commented:
Hi,

   Just use the "lastlog" command or "lastlog user" to know
where that user came from.
    Yes ... the information is stored in wtmp & utmp.

Minh Lai

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Commented:
On most systems, the command is "last".

If you want to see who is _currently_ on the system, use the "who" command (the information for this is in the utmp file, see "man utmp").


UNIX commands have 2 (or 3) characters ;-))
this one exceptionally just 1:
   w

Author

Commented:
Thanks a lot. But I have one more question about utmp and
wtmp. Can we access other people's command history from
utmp and wtmp? Using ps is not capable to capture those
soon finish command, you know.

Commented:
On HP-UX system, You can not access other people's command
history file "~/.sh_history" unless you have super-user's
permission.

Commented:
On HP-UX system, You can not access other people's command
history file "~/.sh_history" unless you have super-user's
permission. I am not sure whether there are similar file
on other UNIX platforms.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.