LinuxQuestions.org
Help answer threads with 0 replies.
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 12-03-2015, 12:25 PM   #1
anisanjum
LQ Newbie
 
Registered: Dec 2015
Posts: 5

Rep: Reputation: Disabled
timestamp of the switching from one user to another


How can we know the timestamp of the switching from one user to another?
 
Old 12-03-2015, 01:20 PM   #2
berndbausch
Senior Member
 
Registered: Nov 2013
Location: Tokyo
Distribution: A few
Posts: 4,143

Rep: Reputation: 1165Reputation: 1165Reputation: 1165Reputation: 1165Reputation: 1165Reputation: 1165Reputation: 1165Reputation: 1165Reputation: 1165
By looking at a log file. On my system running Raspbian it's auth.log.
 
Old 12-03-2015, 01:37 PM   #3
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Yawnstown, Ohio
Distribution: Mojave
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Define 'switching'.

su - <user> or desktop "Switch user" mechanism?
 
Old 12-03-2015, 02:31 PM   #4
anisanjum
LQ Newbie
 
Registered: Dec 2015
Posts: 5

Original Poster
Rep: Reputation: Disabled
How can we know the timestamp of the switching from one user to another?

Suppose we have 2 users in our linux os "anis" and "anjum"
Currently i am working with anis as user.
after some time i change to anjum as user.
So I need to know the timestmp that when did i chenge from anis to anjum.
Thank You..
 
Old 12-03-2015, 03:22 PM   #5
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Yawnstown, Ohio
Distribution: Mojave
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by anisanjum View Post
after some time i change to anjum as user.
Change how?
In terminal(shell) or console...?
 
Old 12-03-2015, 11:43 PM   #6
anisanjum
LQ Newbie
 
Registered: Dec 2015
Posts: 5

Original Poster
Rep: Reputation: Disabled
How can we know the timestamp of the switching from one user to another?

Kindly say for both shell and console.
Thanks
 
Old 12-04-2015, 06:07 AM   #7
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Yawnstown, Ohio
Distribution: Mojave
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by anisanjum View Post
Kindly say for both shell and console.
Thanks
/var/log/auth.log should hold info for all user 'switching' methods.
 
Old 12-04-2015, 11:10 AM   #8
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,667

Rep: Reputation: 494Reputation: 494Reputation: 494Reputation: 494Reputation: 494
It is not certain which folder your distro is keeping the files and probably filename is modified. I am running Slackware (Salix), just try if following instructions will do your purpose.

Be a root first in order to examine following records.

To find out who or which user has logged into the system from boot issue:
Code:
find /var -iname wtmp -exec strings {} +
user names should be found among terse strings. Usually that which beside "tty7" have gone to the X session or the DE since mostly the X server uses tty7 as its device.

Use "id" command to find out the userID number of the user name e.g. "id anis" then take note the userID number because the next report uses userID number.

To find out whether the user logged into the x-session and what time:
Code:
find /var -iname \*history* -exec less {} +
there you find which display was used, whether set-user was attempted, etc.
The user can be known at the logged line "session-unix-user=1000" this value is the userID number.
Timestamps are available.

To find out if some users have tried (succeeded or failed) to take root authority or commands:
Code:
find /var -iname \*secure* -exec cat {} +
you should find the timestamps conveniently listed.

Again, record naming and record keeping can vary between distros so if you are not running Slackware my commands above should need a little modification. Just come back if you have problem locating the files.

Hope that helps.

Goodluck and enjoy.

Last edited by malekmustaq; 12-04-2015 at 11:18 AM.
 
  


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
to know the exact timestamp when the user was created anisanjum Linux - Newbie 3 12-03-2015 02:50 PM
switching user eduardlh Programming 4 08-20-2014 11:38 PM
script to timestamp files with timestamp from directory eRJe Programming 4 11-13-2013 07:52 PM
GUI user switching pixellany Linux - Software 0 04-19-2009 11:41 PM
XP's user switching in redhat ?? Zzapped Linux - Newbie 2 11-08-2003 01:49 PM

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

All times are GMT -5. The time now is 08:25 AM.

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