MOR_SNOW
MOR_SNOW

Reputation: 831

Find out who logged in as me, using su

On linux one can (if he has sudo rights) log in, and take control of another users account/username, doing sudo su - username

But is there a way to find out who logged in like this, and used my account?

Upvotes: 0

Views: 764

Answers (2)

GAD3R
GAD3R

Reputation: 4635

You can use last command .

man last :

last, lastb - show a listing of last logged in users

DESCRIPTION

       last  searches  back through the /var/log/wtmp file (or the file desig‐
       nated by the -f option) and displays a list of all users logged in (and
       out)  since  that  file was created.  One or more usernames and/or ttys
       can be given, in which case last will show only  the  entries  matching
       those  arguments.  Names of ttys can be abbreviated, thus last 0 is the
       same as last tty0.

Upvotes: 2

Srini V
Srini V

Reputation: 11375

/var/log/auth.log contains the logging information for sudo attempts in ubuntu

Upvotes: 1

Related Questions