### 28. chmod
Every file in the Linux / macOS Operating Systems (and UNIX systems in general) has 3 permissions: 0 码力 |
112 页 |
13.74 MB
| 2 年前 3
|gunzip|
|tar|
|alias|
|cat|
|less|
|tail|
|wc|
|grep|
|sort|
|unique\_id|
|---|
|diff|
|echo|
|chown|
|chmod|
|mask|
|du|
|df|
|basename|
|dirname|
|ps|
|top|
|kill|
|killall|
|jobs|
|bg|
|fg|
|type|
|which| command:
chgrp
## chmod
Every file in the Linux / macOS Operating Systems (and UNIX systems in general) has 3 permissions: permissions: rw-, r--, r-x, and so on.
You can change the permissions given to a file using the chmod command.
chmod can be used in 2 ways. The first is using symbolic arguments, the second is using numeric
0 码力 |
135 页 |
14.14 MB
| 2 年前 3
group ..... 32
5.11 Adding new group to an user ..... 32
6 File permissions ..... 33
6.1 chmod command ..... 33
6.2 PATH variable ..... 34
6.3 ~/.bash_profile file ..... 34
6.4 .bashrc file format along with the $ chmod $ command to change permissions of any file or directory.
### 6.1 chmod command
chmod is the command which changes the file mode bits. Through chmod command one can alter and execute) to file system objects (i.e files and directories). If we look at the command closely chmod is the abbreviation of change mode. A few examples are given below.
$ echo "hello" > myfile
0 码力 |
128 页 |
716.99 KB
| 2 年前 3
you must run 'chmod +x /etc/rc.d/rc.local' to that this script will be executed during boot.
### 6. 然后给该文件添加可执行权限
命令 chmod +x /etc/rc.d/rc.local
[root@localhost ~]# chmod +x /etc/rc.d/rc.local ③修改文件权限
#chmod 775 文件名
//把文件的权限改为 775(rwxrwxr-x)
#chmod +x 文件名
//增加文件的 x 权限,即每一组都加上 x 执行权限
#chmod g+w 文件名
//增加组成员的 w 写权限,g 代表文件属组 group
#chmod u+x 文件名
//增加文件拥有者的 x 执行权限,u 代表拥有者 user
#chmod o-w sticky-bit 值为 1
## 特殊权限的设置
#chmod 4755 文件名
//添加 suid 权限,(其他 3 个权限为 755)
#chmod u+s 文件名
//添加 suid 权限,以字母的形式添加
#chmod g+s 文件名
//添加 sgid 权限
#chmod o+t 文件名
//添加 sticky-bit 权限
#chmod 0755 文件名
//设置权限为 0755,无特殊权限
0 码力 |
115 页 |
8.68 MB
| 2 年前 3
details
Deleting a user
Adding a new group
Adding new group to an user
File permissions
chmod command
PATH variable
~.bash_profile file
.bashrc file
/etc/profile file
which command format along with the $ chmod $ command to change permissions of any file or directory.
## chmod command
chmod is the command which changes the file mode bits. Through chmod command one can alter the and execute) to file system objects (i.e files and directories). If we look at the command closely chmod is the abbreviation of change mode. A few examples are given below.
$ echo "hello" > myfile
0 码力 |
124 页 |
510.85 KB
| 2 年前 3
| grep etcd
Run the below command (based on the etcd data directory found above). For example,
chmod 700 /var/lib/etcd
##### Audit Script: 1.1.11.sh
#!/bin/bash -e
etcd_bin= {1}
test_dir= (ps -ef | Run the below command (based on the file location on your system) on the master node. For example,
chmod -R 644 /etc/kubernetes/ssl
Audit Script: check_files_permissions.sh
#!/usr/bin/env bash
# This Run the below command (based on the file location on your system) on the master node. For example,
chmod -R 600 /etc/kubernetes/ssl/certs/serverca
##### Audit Script: 1.1.21.sh
#!/bin/bash -e
check_d
0 码力 |
54 页 |
447.77 KB
| 2 年前 3
| grep etcd
Run the below command (based on the etcd data directory found above). For example,
chmod 700 /var/lib/etcd
##### Audit Script: 1.1.11.sh
#!/bin/bash -e
etcd_bin= {1}
test_dir= (ps -ef | Run the below command (based on the file location on your system) on the master node. For example,
chmod -R 644 /etc/kubernetes/ssl
Audit Script: check_files_permissions.sh
#!/usr/bin/env bash
# This Run the below command (based on the file location on your system) on the master node. For example,
chmod -R 600 /etc/kubernetes/ssl/certs/serverca
##### Audit Script: 1.1.21.sh
#!/bin/bash -e
check_d
0 码力 |
54 页 |
447.97 KB
| 2 年前 3
-#LO https://github.com/FISCO-BCOS/FISCO-BCOS/releases/download/v2.9.0/build_chain.sh && chmod u+x build_chain.sh
## 注解
- 如果因为网络问题导致长时间无法下载build_chain.sh脚本,请尝试 curl -#LO https://osp-1257653870 70.cos.ap-guangzhou.myqcloud.com/FISCO-BCOS/FISCO-BCOS/releases/v2.9.0/build_chain.sh && chmod u+x build_chain.sh
 -#LO https://github.com/FISCO-BCOS/FISCO-BCOS/releases/download/v2.6.0/bui
ld_chain.sh && chmod u+x build_chain.sh
############################################################ 100.0%
########
0 码力 |
2585 页 |
166.09 MB
| 2 年前 3