首页 » 网站建设 » phpexec写文件权限技巧_3linux敕令权限治理

phpexec写文件权限技巧_3linux敕令权限治理

访客 2024-10-27 0

扫一扫用手机浏览

文章目录 [+]

文件属性

[root@eric ~]# ll

phpexec写文件权限技巧_3linux敕令权限治理

total 153936

phpexec写文件权限技巧_3linux敕令权限治理
(图片来自网络侵删)

-rw-r-----. 1 root root 0 Jul 31 16:51 123.txt

-rw-------. 1 root root 1759 Mar 24 16:51 anaconda-ks.cfg

-rw-------. 1 root root 5222400 Jul 24 23:13 core.2366

当为 d 则是目录;

当为 - 则是文件;

若是 l 则表示为链接文档(link file);

若是 b 则表示为装置文件里面的可供储存的接口设备(可随机存取装置);

若是 c 则表示为装置文件里面的串行端口设备,例如键盘、鼠标(一次性读取装置)。

r - read 读权限

w - write 写权限

x - exec 执⾏权限

s 当文件被实行时,把该文件的UID或GID授予实行进程的UID(用户ID)或GID(组 ID)。

t 设置标志位(sticky bit)。
如果是有sticky bit的目录,在该目录下任何用户只要有适当的权限即可创建文

件,但文件只能被超级用户、目录拥有者或文件属主删除。
如果是有sticky bit的可实行文件,在该文件实行后, 指向其正文段的指针仍留在内存。
这样再次实行它时,系统就能更快地装入该文件。

- 没有相应位置的权限。

linux命令-权限管理

1.系统权限

2.做事权限

3.防⽕墙firewall权限

4.SElinux权限

系统权限

普通系统权限

分外系统权限

默认系统权限

分外ACL权限

chmod

chmod [who] [+|-|=] [mode] 文件名

[root@eric ~]# chmod --help

Usage: chmod [OPTION]... MODE[,MODE]... FILE...

or: chmod [OPTION]... OCTAL-MODE FILE...

or: chmod [OPTION]... --reference=RFILE FILE...

Change the mode of each FILE to MODE.

With --reference, change the mode of each FILE to that of RFILE.

-c, --changes like verbose but report only when a change is made

-f, --silent, --quiet suppress most error messages

-v, --verbose output a diagnostic for every file processed

--no-preserve-root do not treat '/' specially (the default)

--preserve-root fail to operate recursively on '/'

--reference=RFILE use RFILE's mode instead of MODE values

-R, --recursive change files and directories recursively

--help display this help and exit

--version output version information and exit

Each MODE is of the form '[ugoa]([-+=]([rwxXst]|[ugo]))+|[-+=][0-7]+'.

GNU coreutils online help: <http://www.gnu.org/software/coreutils/>

For complete documentation, run: info coreutils 'chmod invocation'

chmod [修正的权限] [⽂件/⽬录]

u 修正⽂件拥有者权限

g 修正⽂件所属组权限

o 修正⽂件其他⼈权限

a 所有

+ 添加某个权限

- 删除某个权限

= 授予某个权限

chmod u+x 123.txt # 为文件拥有者添加实行权限

chmod g+x 123.txt # 为文件所属组添加实行权限

chmod o+x 123.txt # 为文件其他人添加实行权限

chmod o=--- 123.txt #为文件其他人赋值实行权限

chmod o=rwx 123.txt #为文件其他人赋值实行权限

chmod 754 123.txt #为文件赋值实行权限

默认权限

[root@eric ~]# umask

0022

变更拥有者或者所属组

chown eric 123.txt 修正拥有者

chown eric:eric 123.txt # 修正拥有者:所属组

chgrp root 123.txt #变更所属组

标签:

相关文章

vuephp实例技巧_vue2 PHP 交互

vue只关注视图层1.以PHP为例,首先须要引入,我们利用CDN,地址是&lt;script src=\公众https:/...

网站建设 2024-12-07 阅读0 评论0

ajax和php实例技巧_PHPAJAX 与 PHP

AJAX PHP 实例下面的实例将演示当用户在输入框中键入字符时,网页如何与 Web 做事器进行通信:实例考试测验在输入框中输入一...

网站建设 2024-12-07 阅读0 评论0