linux权限管理

1、改变某个用户对文件的属主、属组

解释:-rw-r--r--  所有者、所有组、其他用户对文件的权限


改变前

[root@test2 ~]# ll /etc/etcd/pki*
total 8
-rw------- 1 root root 227 Jan 25 08:48 etcd-key.pem
-rw-r--r-- 1 root root 806 Jan 25 08:48 etcd.pem

[root@test2 ~]# systemctl daemon-reload && systemctl restart etcd
Job for etcd.service failed because the control process exited with error code. See "systemctl status etcd.service" and "journalctl -xe" for details.

启动etcd失败原因:etcd-key.pem、etcd.pem 的属主、属组是 root,etcd用户对etcd-key.pem、etcd.pem没有执行权限,


改变

chown -R etcd:etcd /etc/etcd/pki/*


改变后

[root@test2 ~]# ll /etc/etcd/pki*
total 8
-rw------- 1 etcd etcd 227 Jan 25 08:48 etcd-key.pem
-rw-r--r-- 1 etcd etcd 806 Jan 25 08:48 etcd.pem

[root@test2 ~]# systemctl daemon-reload && systemctl restart etcd
[root@test2 ~]# 



2、授权用户、组、其他人对 test.txt 文件的读、写 权限

chmod -R u=rx,g=rx,o=rx
原文地址:https://www.cnblogs.com/effortsing/p/10322075.html