Linux下檔案許可權管理
阿新 • • 發佈:2018-12-18
檔案許可權 1.檔案屬性的檢視 ls -l filename 2.檔案所有人所有組的管理 chown username file|dir chgrp groupname file|dir
chown -R username dir /更改目錄本身及裡面所有內容的所有人 chgrp -R groupname dir/更改目錄本身及裡面所有內容的所有組
監控命令 watch -n 1 ls -lR mnt 3.檔案普通許可權 rw-|r–|r– u g o u:檔案所有人對檔案可讀 g:檔案組成員對檔案可度 o:其他人對檔案可讀 u優先匹配,g次優先,o當u,g不匹配時匹配 4.字元方式修改該檔案的許可權 chmod u-x file1 /file1擁有著去掉x許可權
4.系統預設許可權的設定 umask 預設許可權為022 umask 077 /臨時設定,只在當前shell中生效 vim /etc/bashrc //shell vim /etc/profile //系統 以上兩個檔案umask必須保持一致 source /etc/bashrc source /etc/profile 讓設定立即生效
沒加許可權之前