7、其他权限管理命令
来源:互联网 发布:皮肤软件下载 编辑:程序博客网 时间:2024/05/16 09:23
缺省用户和用户组的说明
一个用户创建的文件默认的所有者是创建者,所属组是所属用户的缺省组,只有所有者和root用户可以修改一个文件的权限,但是只有root可以修改文件的所有者。
修改文件所有者 chown
shell
[root@localhost tmp]# useradd qinxianyou
[root@localhost tmp]# passwd qinxianyou
更改用户 qinxianyou 的密码 。
新的 密码:
重新输入新的 密码:
passwd: 所有的身份验证令牌已经成功更新。
[root@localhost tmp]# chown qinxianyou duanbang.grant
[root@localhost tmp]# ls -l
总用量 0
-rwxrwxrwx. 1 qinxianyou root 0 9月 25 05:45 duanbang.grant
-rw-------. 1 root root 0 9月 24 02:04 yum.log
[root@localhost tmp]#
修改文件分组 chgrp
shell
[root@localhost tmp]# groupadd commonuser
[root@localhost tmp]# chgrp commonuser duanbang.grant
[root@localhost tmp]# ls -l
总用量 0
-rwxrwxrwx. 1 qinxianyou commonuser 0 9月 25 05:45 duanbang.grant
-rw-------. 1 root root 0 9月 24 02:04 yum.log
[root@localhost tmp]#
权限管理命令 umask
[root@localhost tmp]# umask -Su=rwx,g=rx,o=rx[root@localhost tmp]# pwd/tmp[root@localhost tmp]# mkdir test[root@localhost tmp]# ls -ld testdrwxr-xr-x. 2 root root 4096 9月 25 06:14 test[root@localhost tmp]# ls -l总用量 4-rwxrwxrwx. 1 qinxianyou commonuser 0 9月 25 05:45 duanbang.grantdrwxr-xr-x. 2 root root 4096 9月 25 06:14 test-rw-------. 1 root root 0 9月 24 02:04 yum.log[root@localhost tmp]# rm -f duanbang.grant[root@localhost tmp]# ls -l总用量 4drwxr-xr-x. 2 root root 4096 9月 25 06:14 test-rw-------. 1 root root 0 9月 24 02:04 yum.log[root@localhost tmp]# touch test[root@localhost tmp]# ls -l总用量 4drwxr-xr-x. 2 root root 4096 9月 25 06:15 test-rw-------. 1 root root 0 9月 24 02:04 yum.log[root@localhost tmp]# touch test.file[root@localhost tmp]# ls -l总用量 4drwxr-xr-x. 2 root root 4096 9月 25 06:15 test-rw-r--r--. 1 root root 0 9月 25 06:16 test.file-rw-------. 1 root root 0 9月 24 02:04 yum.log[root@localhost tmp]# umask0022[root@localhost tmp]# umask 023[root@localhost tmp]# umask -Su=rwx,g=rx,o=r[root@localhost tmp]# umask -Su=rwx,g=rx,o=r[root@localhost tmp]# mkdir test1[root@localhost tmp]# touch test1.file[root@localhost tmp]# ls -l总用量 8drwxr-xr-x. 2 root root 4096 9月 25 06:15 testdrwxr-xr--. 2 root root 4096 9月 25 06:18 test1-rw-r--r--. 1 root root 0 9月 25 06:18 test1.file-rw-r--r--. 1 root root 0 9月 25 06:16 test.file-rw-------. 1 root root 0 9月 24 02:04 yum.log[root@localhost tmp]# umask 022[root@localhost tmp]# umask -Su=rwx,g=rx,o=rx[root@localhost tmp]#
所有文件默认没有执行权限,所以新建的文件权限是 rw- r– r–,而不是像文件夹一样是 rwx r-x r-x
- 7、其他权限管理命令
- 其他权限管理命令
- 权限管理命令-其他权限管理命令
- Linux常用命令-权限管理命令-其他权限管理命令
- linux学习笔记-----其他文件权限管理命令
- Linux中的其他权限命令
- 权限管理命令-权限管理命令chmod
- Linux教程【7】-权限管理命令
- Linux权限管理命令
- linux权限管理命令
- 权限管理命令
- 权限管理命令
- DBA权限管理命令
- Linux权限管理命令
- Linux权限管理命令
- Linux权限管理命令
- linux权限管理命令
- 权限管理命令 chmod
- HDU 3849--By Recognizing These Guys, We Find Social Networks Useful【边双联通 && 求桥的数目 && 输出桥】
- python-字符串拼接
- Flume 1.6.0 User Guide
- 【套题】2015年百度之星程序设计大赛 - 初赛(1)
- Java覆盖和隐藏
- 7、其他权限管理命令
- Callable和Future、FutureTask
- C/C++ 之 ‘++’、‘+’、‘+=’、‘-’、‘()’、‘--’ 操作符的重载实现重载
- Rope大法(可持久化平衡树)
- Java多线程基础知识(四)
- mysql密码找回
- Leetcode - 104 - Maximum Depth of Binary Tree
- STL系列之三 queue 单向队列
- ios跳转设置各种功能