更新文档

This commit is contained in:
SuperManito
2023-05-10 12:49:27 +08:00
parent bbb031e609
commit e4d222eadc
6 changed files with 96 additions and 56 deletions

View File

@@ -72,7 +72,7 @@ GNU/Linux 一键更换系统软件源脚本
</tr> </tr>
</table> </table>
当前支持上述基于 DebianRedHatopenEuleropenSUSEArch Linux 的发行版和及其部分衍生版本 当前支持上述基于 `Debian``RedHat``OpenCloudOS``openEuler``openSUSE``Arch Linux` 的发行版和及其部分衍生版本
点击列表中的图标可快速前往其官网,理论支持所有架构的环境 点击列表中的图标可快速前往其官网,理论支持所有架构的环境
项目已设立开源许可协议,传播时请在显著位置标注来源和作者,请尊重作者的知识成果,建议通过命令直接调用脚本 项目已设立开源许可协议,传播时请在显著位置标注来源和作者,请尊重作者的知识成果,建议通过命令直接调用脚本

View File

@@ -245,5 +245,4 @@ hide:
<button class="md-button md-button--primary" onclick="window.open('https://tools.ipip.net/traceroute.php')">Tracert 路由追踪测试</button> <button class="md-button md-button--primary" onclick="window.open('https://tools.ipip.net/traceroute.php')">Tracert 路由追踪测试</button>
<button class="md-button md-button--primary" onclick="window.open('https://ipw.cn/ipv6webcheck')">IPv6 接入测试</button> <button class="md-button md-button--primary" onclick="window.open('https://ipw.cn/ipv6webcheck')">IPv6 接入测试</button>
!!! tip "" !!! tip "该页面展示的均为脚本默认提供可供选择的软件源地址,如果没有找到你想使用的也没有关系,脚本支持命令选项可自定义使用,详见[高级用法](/use/command-options)。"
该页面展示的均为脚本默认提供可供选择的软件源地址,如果没有找到你想使用的也没有关系,脚本支持命令选项可自定义使用,详见[高级用法](/use/command-options)。

View File

@@ -9,8 +9,8 @@
data-strict="0" data-strict="0"
data-reactions-enabled="1" data-reactions-enabled="1"
data-emit-metadata="0" data-emit-metadata="0"
data-input-position="top" data-input-position="bottom"
data-theme="dark" data-theme="preferred_color_scheme"
data-lang="zh-CN" data-lang="zh-CN"
data-loading="lazy" data-loading="lazy"
crossorigin="anonymous" crossorigin="anonymous"

View File

@@ -1,5 +1,38 @@
## 关于开启 SSH 远程登录的方法
!!! quote ""
- ### 验证是否已安装 `SSH` 服务
``` bash
ls /etc | grep ssh
```
> 如果没有这个文件夹说明系统未安装 `SSH` 服务,你需要通过包管理工具安装 `openssh` 软件包
- ### 设置允许 Root 用户登录
``` bash
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
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
```
- ### 启动/重启 `SSH` 服务
``` bash
ps -ef | grep -q ssh ; [ $? -eq 0 ] && systemctl restart sshd || systemctl enable --now sshd
```
## 关于报错 Command not found ## 关于报错 Command not found
!!! quote ""
- 如果提示 `Command 'curl' not found` 则说明当前未安装 `curl` 软件包 - 如果提示 `Command 'curl' not found` 则说明当前未安装 `curl` 软件包
=== "Debian 系 Linux" === "Debian 系 Linux"
@@ -32,7 +65,9 @@
## 还原已备份的软件源 ## 还原已备份的软件源
=== "Debian 系 Linux" !!! quote ""
=== "Debian 系 Linux"
``` sh ``` sh
cp -rvf /etc/apt/sources.list.bak /etc/apt/sources.list cp -rvf /etc/apt/sources.list.bak /etc/apt/sources.list
@@ -41,7 +76,7 @@
> `Debian` &nbsp; `Ubuntu` &nbsp; `Kali` > `Debian` &nbsp; `Ubuntu` &nbsp; `Kali`
=== "RedHat 系 Linux / OpenCloudOS / openEuler" === "RedHat 系 Linux / OpenCloudOS / openEuler"
``` sh ``` sh
cp -rvf /etc/yum.repos.d.bak /etc/yum.repos.d cp -rvf /etc/yum.repos.d.bak /etc/yum.repos.d
@@ -50,14 +85,14 @@
> `Red Hat Enterprise Linux` &nbsp; `CentOS` &nbsp; `Rocky Linux` &nbsp; `AlmaLinux` &nbsp; `Fedora` &nbsp; `OpenCloudOS` &nbsp; `openEuler` > `Red Hat Enterprise Linux` &nbsp; `CentOS` &nbsp; `Rocky Linux` &nbsp; `AlmaLinux` &nbsp; `Fedora` &nbsp; `OpenCloudOS` &nbsp; `openEuler`
=== "openSUSE" === "openSUSE"
``` sh ``` sh
cp -rvf /etc/zypp/repos.d.bak /etc/zypp/repos.d cp -rvf /etc/zypp/repos.d.bak /etc/zypp/repos.d
zypper ref zypper ref
``` ```
=== "Arch Linux" === "Arch Linux"
``` sh ``` sh
cp -rvf /etc/pacman.d/mirrorlist.bak /etc/pacman.d/mirrorlist cp -rvf /etc/pacman.d/mirrorlist.bak /etc/pacman.d/mirrorlist
@@ -66,4 +101,6 @@
## 其它 ## 其它
!!! quote ""
- 如果提示 `bash: /proc/self/fd/11: No such file or directory`,请切换至 `Root` 用户执行,切换命令为 `su root` - 如果提示 `bash: /proc/self/fd/11: No such file or directory`,请切换至 `Root` 用户执行,切换命令为 `su root`

View File

@@ -27,20 +27,24 @@ bash <(curl -sSL https://linuxmirrors.cn/main.sh) --edu # (1)!
1. 通过 `--edu` 命令选项来使用中国教育单位软件源 1. 通过 `--edu` 命令选项来使用中国教育单位软件源
## 注意事项
- 完整复制上面的命令到终端按回车键即可执行,若无法安装 `curl` 软件包可复制源码到本地后通过 `bash` 手动执行
- 为了适配所有环境,需要使用 `Root` 用户执行脚本,切换命令为 `su root`,如遇报错请查看常见问题与帮助
- 如果你使用的环境没有安装或不支持简体中文环境,请通过 `SSH客户端工具` 使用,否则将无法正确选择交互内容
- 执行脚本过程中会自动备份原有源无需手动备份,期间会在终端输出多个主观选择交互内容,可按回车键快速确定
- 脚本支持在原有源配置错误或者不存在的情况下使用,并且可以重复使用;脚本变更的软件源默认使用 `HTTP` 协议
??? quote "原始执行脚本方法" ??? quote "原始执行脚本方法"
``` bash ``` bash
bash <(curl -sSL https://gitee.com/SuperManito/LinuxMirrors/raw/main/ChangeMirrors.sh) bash <(curl -sSL https://gitee.com/SuperManito/LinuxMirrors/raw/main/ChangeMirrors.sh)
``` ```
!!! danger "" ## 注意事项
:octicons-heart-fill-24:{ .heart style="color: red" } 如果您觉得这个项目不错对您有所帮助的话,方便在仓库右上角给颗 ⭐ 并分享给更多的朋友吗? :material-numeric-1:{style="color: #3CA7E5"} 需使用 `Root` 用户执行脚本
: 切换命令为 `su root`
:material-numeric-2:{style="color: #3CA7E5"} 建议使用 `SSH` 远程工具
: 如果你使用的系统终端界面不支持 `UTF-8` 编码那么将无法正常显示中文内容,导致无法正确选择交互内容。大部分系统都会自动开启该服务,否则请参考[启用方法](/use/help/#%E5%85%B3%E4%BA%8E%E5%BC%80%E5%90%AF-ssh-%E8%BF%9C%E7%A8%8B%E7%99%BB%E5%BD%95%E7%9A%84%E6%96%B9%E6%B3%95)
:material-numeric-3:{style="color: #3CA7E5"} 如果是首次在新系统上执行脚本
: 当前执行方式依赖 `curl` 指令来获取脚本内容并执行,所以需要先通过包管理工具来安装该软件包,否则会报错 `Command not found`,安装方法详见[常见问题](/use/help/#%E5%85%B3%E4%BA%8E%E6%8A%A5%E9%94%99-command-not-found),若无法安装就复制[源码](https://gitee.com/SuperManito/LinuxMirrors/raw/main/ChangeMirrors.sh)到本地新建`.sh`脚本,然后通过 `bash` 手动执行
!!! note ":octicons-heart-fill-24:{ .heart style="color: red" } 如果您觉得这个项目不错对您有所帮助的话,方便在仓库右上角给颗 ⭐ 并分享给更多的朋友吗?"

View File

@@ -17,7 +17,7 @@ theme:
note: octicons/tag-16 note: octicons/tag-16
abstract: octicons/checklist-16 abstract: octicons/checklist-16
info: octicons/info-16 info: octicons/info-16
tip: octicons/squirrel-16 tip: fontawesome/regular/lightbulb
success: octicons/check-16 success: octicons/check-16
question: octicons/question-16 question: octicons/question-16
warning: octicons/alert-16 warning: octicons/alert-16