LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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, 11:25 AM   #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, 12:20 PM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

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

Rep: Reputation: Disabled
Define 'switching'.

su - <user> or desktop "Switch user" mechanism?
 
Old 12-03-2015, 01: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, 02:22 PM   #5
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
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, 10: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, 05:07 AM   #7
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
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, 10:10 AM   #8
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,669

Rep: Reputation: 498Reputation: 498Reputation: 498Reputation: 498Reputation: 498
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 10:18 AM.
 
  


Reply



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 01:50 PM
switching user eduardlh Programming 4 08-20-2014 10:38 PM
script to timestamp files with timestamp from directory eRJe Programming 4 11-13-2013 06:52 PM
GUI user switching pixellany Linux - Software 0 04-19-2009 10:41 PM
XP's user switching in redhat ?? Zzapped Linux - Newbie 2 11-08-2003 12:49 PM

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

All times are GMT -5. The time now is 09:37 PM.

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
Open Source Consulting | Domain Registration