- 论坛徽章:
- 7
|
有个用户组叫test, 有2个用户,test 和sanba.
/home 下于是有:
/test
/sanba
用test账号登录,然后用cd , chmod命令修改test目录的权限.
[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 . //明显权限已经修改了
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这个账号有进入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 . 已经生效了啊。
[sanba@localhost test]$ cd xy
bash: cd: xy: Permission denied
[sanba@localhost test]$ pwd
/home/test
test是用户组,该组下有个用户叫test sanba ,都是普通用户。
我的目的是: sanba 可以进入test用户组里, 至少对/home/test/. 这个目录有权限。
|
|