- 論壇徽章:
- 7
|
有個用戶組叫test, 有2個用戶,test 和sanba.
/home 下于是有:
/test
/sanba
用test賬號登錄,然后用cd , chmod命令修改test目錄的權(quán)限.
[test@localhost ~]$ ls -al
total 36
drwx------. 5 test test 4096 Jun 21 01:27 .
drwxr-xr-x. 4 root root 26 Jun 20 17:20 ..
-rw-rw-r--. 1 test test 0 Jun 20 17:43 1.txt
-rw-------. 1 test test 3095 Jun 20 20:00 .bash_history
-rw-r--r--. 1 test test 18 Mar 6 06:06 .bash_logout
-rw-r--r--. 1 test test 194 Jun 17 11:28 .bash_profile
-rw-r--r--. 1 test test 231 Mar 6 06:06 .bashrc
-rw-------. 1 test test 69 Jun 17 09:29 .lesshst
-rwxr-xr-x. 1 root root 89 Jun 15 22:16 mountshell
-rw-r--r--. 1 root root 6 Jun 17 14:11 mytestdd
drwxr-xr-x. 2 root root 6 Jun 21 01:28 shares
drwxr-xr-x. 6 root root 56 Jun 19 04:22 .vim
-rw-------. 1 test test 3476 Jun 20 17:43 .viminfo
drwxrwxr-x. 2 test test 6 Jun 20 17:43 xy
[test@localhost ~]$ chmod 766 .
[test@localhost ~]$ ls -al
total 36
drwxrw-rw-. 5 test test 4096 Jun 21 01:27 . //明顯權(quán)限已經(jīng)修改了
drwxr-xr-x. 4 root root 26 Jun 20 17:20 ..
-rw-rw-r--. 1 test test 0 Jun 20 17:43 1.txt
-rw-------. 1 test test 3095 Jun 20 20:00 .bash_history
-rw-r--r--. 1 test test 18 Mar 6 06:06 .bash_logout
-rw-r--r--. 1 test test 194 Jun 17 11:28 .bash_profile
-rw-r--r--. 1 test test 231 Mar 6 06:06 .bashrc
-rw-------. 1 test test 69 Jun 17 09:29 .lesshst
-rwxr-xr-x. 1 root root 89 Jun 15 22:16 mountshell
-rw-r--r--. 1 root root 6 Jun 17 14:11 mytestdd
drwxr-xr-x. 2 root root 6 Jun 21 01:28 shares
drwxr-xr-x. 6 root root 56 Jun 19 04:22 .vim
-rw-------. 1 test test 3476 Jun 20 17:43 .viminfo
drwxrwxr-x. 2 test test 6 Jun 20 17:43 xy
說明sanba這個賬號有進(jìn)入test目錄里。
于是:
[test@localhost ~]$ su sanba
Password:
[sanba@localhost test]$ pwd
/home/test
[sanba@localhost test]$ ls -al
ls: cannot open directory .: Permission denied //why?chmod 766 . 已經(jīng)生效了啊。
[sanba@localhost test]$ cd xy
bash: cd: xy: Permission denied
[sanba@localhost test]$ pwd
/home/test
test是用戶組,該組下有個用戶叫test sanba ,都是普通用戶。
我的目的是: sanba 可以進(jìn)入test用戶組里, 至少對/home/test/. 這個目錄有權(quán)限。
|
|