How does Linux run programs in different user identities?
In the process of managing Linux, some of the time we need to specific users, given certain permissions to execute certain programs, how should we specify a different user identity to run the corresponding program? We can do this through the SU command:
Su-userhttp://www.aliyun.com/zixun/aggregation/11696.html ">name-c"/path/to/command "
Examples are as follows:
[Root@localhost software]# Whereis ls
LS:/bin/ls/usr/share/man/man1/ls.1.gz/usr/share/man/man1p/ls.1p.gz
[Root@localhost webserver]# su-www-c "/bin/ls"
[Root@localhost webserver]# su www
[Www@localhost webserver]$ Ls-la
Total Dosage 32
Drwxr-xr-x. 5 www. 4096 June 11 12:32.
Dr-xr-xr-x. Root 4096 June 13 14:00.
Drwxr-xr-x. 2 www. 4096 June 12:35 Logs
DRWX------. 2 www. 16384 June 8 16:21 Lost+found
Drwxr-xr-x. www www. 4096 June 16:53 www
Sometimes you need to run a special identity program so that SU can do