Chinaunix

标题: [SOLARIS] about chmod 1,2,4... [打印本页]

作者: netbanker    时间: 2002-04-26 03:36
标题: [SOLARIS] about chmod 1,2,4...
when using chmod, the syntax is chmod ****  filename, notice we can use four numbers, i check the document and it mentions that the first number can be 1: sticky bit, 2: setguid, 4: setuid. SO what is the meaing for that?

can anyone show an example?  



作者: gangang    时间: 2002-04-26 09:16
setuid: everyone run this command as the the owoner who\'s runing the command.
setgid: everyone run this command as the the owoner whose group member is runing the command
sticky bit: when set sticky bit for a share directory(rwxrwxrwx),only the file ower and the shared directory owner can delete the files in the shared directory.
作者: gangang    时间: 2002-04-26 09:24
for example:

/usr/sbin/format : althrough common user have the exec promission to run this command, when common user try to run the command , they will recieve error message, because the command will verify that if the runner is root or not.
if you : chmod 4755 /usr/sbin/format
common user can run the commat correctly.




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2