-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add image remote url and add linux auth content
- Loading branch information
Showing
32 changed files
with
216 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
--- | ||
layout: doc | ||
--- | ||
|
||
# 权限相关 | ||
|
||
## 权限的作用 | ||
|
||
- 对`文件来`说最高权限是`x(可执行)` | ||
|
||
- 对`目录`来讲最高权限是`w(可写)`,对目录有了`w`权限,就可以做任何事情 | ||
|
||
## 权限详情 | ||
|
||
| 权限项 | 读 | 写 | 执行 | | ||
|:----:|:-----:|:-----:|:-----:| | ||
| 字符表示 | r | w | x | | ||
| 数字表示 | 4 | 2 | 1 | | ||
|
||
### 文件权限 | ||
|
||
| 权限 | 含义 | 示例 | | ||
|:---:|:-----------------------------:|:--------------------------:| | ||
|r| 读取文件内容 | `cat`、`more`、`head`、`tail` | | ||
|w| 编辑、新增、修改文件内容,`不能删除文件`,除非对目录有`写权限` | `vim`、`echo` | | ||
|x|可执行| ./xxx.sh | | ||
|
||
### 文件夹(目录)权限 | ||
|
||
| 权限 | 含义 | 示例 | | ||
|:---:|:----------------------------------------:|:----------------------:| | ||
|r| 可以查看目录下的文件名 | `ls`、`ll`、`la` | | ||
|w| 具有`修改目录结构`的权限。如`新建`、`删除`、`重命名`此目录下的文件和目录 | `touch`、`rm`、`mv`、`cp` | | ||
|x| 可进入目录 | `cd` | | ||
|
||
### 权限位 | ||
|
||
执行`la`,查看权限,例如:`drwx------` | ||
|
||
```shell | ||
➜ js-project la | ||
total 72 | ||
drwxr-xr-x@ | ||
drwxr-xr-x@ | ||
-rw-r--r--@ | ||
``` | ||
|
||
`权限位`总共十位 | ||
|
||
- 第`1`位表示`文件类型` | ||
- `d`:文件夹 | ||
- `l`:软链接文件 | ||
- `-`:普通文件 | ||
|
||
- 第`2-4`位表示`文件拥有者权限` | ||
- `r`:可读 | ||
- `w`:可写 | ||
- `x`:可执行 | ||
- `-`:什么权限都没有 | ||
|
||
- 第`5-7`位表示`文件所属群组权限` | ||
- `r`:可读 | ||
- `w`:可写 | ||
- `x`:可执行 | ||
- `-`:什么权限都没有 | ||
|
||
- 第`8-10`位表示`其他人的权限` | ||
- `r`:可读 | ||
- `w`:可写 | ||
- `x`:可执行 | ||
- `-`:什么权限都没有 | ||
|
||
## 修改权限 | ||
|
||
|
||
### `chmod` | ||
|
||
> 改变`文件权限` | ||
```shell | ||
chmod [选项] 模式 文件名 | ||
chmod [ugoa] [+-=] [rwx] 文件/目录 | ||
``` | ||
:::tip | ||
- `u`:代表所有者 | ||
- `g`:代表所属组 | ||
- `o`:代表其他人 | ||
- `a`:所有 | ||
- `+`:增加权限 | ||
- `-`:去除权限 | ||
- `=`:赋予权限 | ||
::: | ||
|
||
> 例如: | ||
```shell | ||
chmod a+/-x filename // 给所有人增加/移除x(可执行)权限 | ||
``` | ||
|
||
### `chown` | ||
|
||
> 改变`文件拥有者` | ||
```shell | ||
chown 用户名 文件名 | ||
``` | ||
|
||
### `chgrp` | ||
|
||
> 改变`文件所属群组` | ||
```shell | ||
chgrp 组名 文件名 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
layout: doc | ||
--- | ||
|
||
# 用户操作相关 | ||
|
||
## 查看用户列表 | ||
|
||
```shell | ||
cat /etc/passwd | ||
``` | ||
|
||
## 切换用户 | ||
|
||
```shell | ||
su username | ||
``` | ||
|
||
## root用户才有的操作 | ||
|
||
:::warning | ||
以下操作只有`root`账号才可以可用 | ||
::: | ||
|
||
### 添加新用户 | ||
|
||
```shell | ||
adduser username | ||
``` | ||
|
||
### 给已创建的用户user设置密码 | ||
|
||
```shell | ||
passwd username | ||
``` | ||
|
||
### 为用户添加权限 | ||
|
||
```shell | ||
gpasswd -h 查看操作 | ||
``` | ||
|
||
- `-a`:添加用户到组 | ||
|
||
- `-d`:从组删除用户 | ||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.