Ping 是一个由 root 拥有的程序,用户 id 位被设置。
$ ls -l `which ping`
-rwsr-xr-x 1 root root 35752 Nov 4 2011 /bin/ping
Run Code Online (Sandbox Code Playgroud)
据我了解,如果用户运行 ping 进程,那么有效用户 ID 将从真实用户 ID(即启动该进程的人的用户 ID)更改为用户 ID root。但是,当我尝试这样做并查看 ps 的输出以查看 ping 进程是否以 root 用户身份运行时,我仍然显示真实的用户 ID。
ps -e -o user,ruser,euser,cmd,args | grep ping
sashan sashan sashan ping -i 10 -c 1000 www.goog ping -i 10 -c 1000 www.google.com
Run Code Online (Sandbox Code Playgroud)