(1) Query user information currently logged in W or who
[@bjzw_11_210 ~]#W -:Geneva: -Up342Days -: on,2Users, load average:0.03,0.04,0.00USER TTY from [email protected] IDLE jcpu PCPU whatroot pts/0 10.149.239.20Thu130.00s0.19s0.00sWGuest pts/2 10.139.239.20Thu15 A: 43m0.02s0.02s-bash
The first line shows the current time, how long the boot (up), the average load of several users on the system, etc.
The second line is the description of each item (column name);
After the third row, each row represents a user. As above, root login, and get the terminal name PTS/0,PTS/1 and so on.
W.H.O. Root pts/0 -- 10.149. 239.20) root pts/1 -20 : 10.149. 239.20)
(2) Check the last login time of each account Lastlog
[@tc_62_179 blog_spider]# lastlogusername Port from latestroot pts/1 10.149.239.20Thu Dec7 -: A: ++0800 .bin**never loggedinch**Daemon**never loggedinch**ADM**never loggedinch**LP**never loggedinch**Sync**never loggedinch**shutdown**never loggedinch**Halt**never loggedinch**Mail**never loggedinch**operator**never loggedinch** Games**never loggedinch**FTP**never loggedinch**Nobody**never loggedinch**Avahi-AUTOIPD **never Loggedinch**systemd-bus-proxy **never Loggedinch**systemd-network **never Loggedinch**Dbus**never loggedinch**POLKITD**never loggedinch**ABRT**never loggedinch**Libstoragemgmt**never loggedinch**RPC**never loggedinch**postfix**never loggedinch**PCP**never loggedinch**TSS**never loggedinch**Unbound**never loggedinch**NTP**never loggedinch**Rpcuser**never loggedinch**Nfsnobody**never loggedinch**SSSD**never loggedinch**Chrony**never loggedinch**sshd**never loggedinch**tcpdump**never loggedinch**Oprofile**never loggedinch**Odin pts/0 10.142.239.25Sun Nov A +: -: One+0800 .Apache**never loggedinch**Netmonitor**never loggedinch**Guest**never loggedinch**NSCD**never loggedinch**
The essence is to view/var/log/lastlog
(3) View information ID of the owner group of the specified user
ID uid=0(root) gid=0Groups=0ID odinuid= Odin gid=Groups= (Odin),6(disk)
Linux User information Query