There are several methods to identify who logged in your Linux system.
1. See who is logged on
1 2 3 4 5 |
$ who jason pts/0 2015-03-27 17:15 (10.1.10.230) simith pts/1 2015-03-27 13:15 (10.1.10.212) |
2. Print effective username you are using
1 2 3 4 |
$ whoami jason |
or use “who am I”
1 2 3 4 |
$ who am i jason pts/0 2015-03-27 17:15 (10.1.10.230) |
3. Get the user login history
1 2 3 4 5 6 7 8 9 |
$ last jason jason pts/0 10.1.10.230 Fri Mar 27 17:15 still logged in jason pts/0 10.1.10.195 Thu Mar 26 16:52 - 17:49 (00:57) jason pts/1 10.1.10.195 Thu Mar 26 13:17 - 15:34 (02:17) jason pts/0 10.1.10.195 Thu Mar 26 10:30 - 13:26 (02:55) jason pts/0 10.1.10.171 Wed Mar 25 17:45 - 18:34 (00:48) jason pts/0 10.1.10.114 Mon Mar 23 17:28 - 18:27 (00:58) |
4. Show who is logged on and what they are doing
w displays information about the users currently on the machine, and their processes. The header shows, in this order, the current time, how long the system has been running, how many users are currently logged on, and the system load averages for the past 1, 5, and 15 minutes.
1 2 3 4 5 6 |
$ w 17:28:12 up 204 days, 12 min, 5 users, load average: 0.26, 0.20, 0.36 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT jason pts/0 10.1.10.230 17:15 0.00s 0.02s 0.00s w |