Quantcast
Channel: Java mon amour
Viewing all articles
Browse latest Browse all 1124

whoami vs who am i

$
0
0
ok this is like Linux 101:

[root@osb-vagrant ~]# who am i
root pts/1 2013-11-19 11:01 (10.0.2.2)
[root@osb-vagrant ~]# whoami
root
[root@osb-vagrant ~]# sudo -u soa whoami
soa
[root@osb-vagrant ~]# sudo -u soa who am i
root pts/1 2013-11-19 11:01 (10.0.2.2)


So if you allow some user to sudo a command, and you want to log who that user is, you should use "who am i" and not "whoami".

Viewing all articles
Browse latest Browse all 1124

Trending Articles