This commit is contained in:
Super Manito
2025-11-30 04:58:43 +08:00
parent 7667285f90
commit 78baade68f
4 changed files with 96 additions and 70 deletions

View File

@@ -410,11 +410,11 @@ hide:
- Configure `SSH` service
``` { .bash .no-copy title="Allow root account login" }
``` { .bash title="Allow root account login" }
cat /etc/ssh/sshd_config | grep -Eq "^[# ]?PermitRootLogin " ; [ $? -eq 0 ] && sed -i 's/^[# ]\?PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config || echo -e "\nPermitRootLogin yes" >> /etc/ssh/sshd_config
```
``` { .bash .no-copy title="Enable password authentication" }
``` { .bash title="Enable password authentication" }
cat /etc/ssh/sshd_config | grep -Eq "^[# ]?PasswordAuthentication " ; [ $? -eq 0 ] && sed -i 's/^[# ]\?PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config || echo -e "\nPasswordAuthentication yes" >> /etc/ssh/sshd_config
```

View File

@@ -412,11 +412,11 @@ hide:
- 配置 `SSH` 服务
``` { .bash .no-copy title="允许 root 账户登录" }
``` { .bash title="允许 root 账户登录" }
cat /etc/ssh/sshd_config | grep -Eq "^[# ]?PermitRootLogin " ; [ $? -eq 0 ] && sed -i 's/^[# ]\?PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config || echo -e "\nPermitRootLogin yes" >> /etc/ssh/sshd_config
```
``` { .bash .no-copy title="启用密码认证" }
``` { .bash title="启用密码认证" }
cat /etc/ssh/sshd_config | grep -Eq "^[# ]?PasswordAuthentication " ; [ $? -eq 0 ] && sed -i 's/^[# ]\?PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config || echo -e "\nPasswordAuthentication yes" >> /etc/ssh/sshd_config
```

View File

@@ -412,11 +412,11 @@ hide:
- 設定 `SSH` 服務
``` { .bash .no-copy title="允許 root 帳戶登入" }
``` { .bash title="允許 root 帳戶登入" }
cat /etc/ssh/sshd_config | grep -Eq "^[# ]?PermitRootLogin " ; [ $? -eq 0 ] && sed -i 's/^[# ]\?PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config || echo -e "\nPermitRootLogin yes" >> /etc/ssh/sshd_config
```
``` { .bash .no-copy title="啟用密碼認證" }
``` { .bash title="啟用密碼認證" }
cat /etc/ssh/sshd_config | grep -Eq "^[# ]?PasswordAuthentication " ; [ $? -eq 0 ] && sed -i 's/^[# ]\?PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config || echo -e "\nPasswordAuthentication yes" >> /etc/ssh/sshd_config
```