From 876752fb3d8065069cdb3550a088ed30184348fe Mon Sep 17 00:00:00 2001 From: Rudy_Tan Date: Tue, 21 Jan 2020 22:15:38 +0800 Subject: [PATCH] modify Adminstration --- ...06\351\205\215\347\211\271\346\235\203.md" | 7 +++ ...56\344\270\273\346\234\272\345\220\215.md" | 4 +- .../\344\275\277\347\224\250nmcli-1.md" | 2 +- ...21\347\234\240\347\263\273\347\273\237.md" | 25 +--------- ...16\345\261\236\346\216\245\345\217\243.md" | 5 +- ...45\272\217\357\274\210cron\357\274\211.md" | 6 +-- ...20\350\241\214\347\272\247\345\210\253.md" | 50 ++++++++++--------- ...46\233\264\346\226\260repo\346\272\220.md" | 1 + ...47\275\256IPv6\345\234\260\345\235\200.md" | 2 +- .../\346\246\202\350\277\260.md" | 2 +- ...50\350\275\257\344\273\266\346\272\220.md" | 2 +- ...346\250\241\345\235\227\345\222\214SSL.md" | 27 +++++++++- ...73\347\273\237\346\234\215\345\212\241.md" | 44 ++++++++-------- ...345\217\226ISO\351\225\234\345\203\217.md" | 4 +- ...24\346\227\266\345\207\272\351\224\231.md" | 2 +- ...\346\200\201IP\350\277\236\346\216\245.md" | 15 ------ ...30\350\256\244\347\275\221\345\205\263.md" | 8 +-- 17 files changed, 102 insertions(+), 104 deletions(-) diff --git "a/content/zh/docs/Administration/\344\270\272\346\231\256\351\200\232\347\224\250\346\210\267\345\210\206\351\205\215\347\211\271\346\235\203.md" "b/content/zh/docs/Administration/\344\270\272\346\231\256\351\200\232\347\224\250\346\210\267\345\210\206\351\205\215\347\211\271\346\235\203.md" index 3dbc70e..03cadf0 100644 --- "a/content/zh/docs/Administration/\344\270\272\346\231\256\351\200\232\347\224\250\346\210\267\345\210\206\351\205\215\347\211\271\346\235\203.md" +++ "b/content/zh/docs/Administration/\344\270\272\346\231\256\351\200\232\347\224\250\346\210\267\345\210\206\351\205\215\347\211\271\346\235\203.md" @@ -41,10 +41,17 @@ sudo /usr/sbin/useradd newuserl 这一句说明ted1可以在ted2主机上运行关机命令。 + ``` + newuser1 ted1=(root) /usr/sbin/useradd,/usr/sbin/userdel + ``` + + 这一句说明ted1主机上的newuser1具有以root用户权限执行useradd,userdel命令的功能。 + >![](public_sys-resources/icon-note.gif) **说明:** >- 可以在一行定义多个别名,中间用冒号 \(:\) 隔开。 >- 可在命令或命令别名之前加上感叹号 \(!\),使该命令或命令别名无效。 >- 有两个关键词:ALL和NOPASSWD。ALL意味着“所有”(所有文件、所有主机或所有命令),NOPASSWD意味着不用密码。 + >- 通过修改用户访问,将普通用户的访问权限修改为同root一样,则可以给普通用户分配特权。 下面是一个sudoers文件的例子: diff --git "a/content/zh/docs/Administration/\344\275\277\347\224\250hostnamectl\351\205\215\347\275\256\344\270\273\346\234\272\345\220\215.md" "b/content/zh/docs/Administration/\344\275\277\347\224\250hostnamectl\351\205\215\347\275\256\344\270\273\346\234\272\345\220\215.md" index 472fe3e..a9675fb 100644 --- "a/content/zh/docs/Administration/\344\275\277\347\224\250hostnamectl\351\205\215\347\275\256\344\270\273\346\234\272\345\220\215.md" +++ "b/content/zh/docs/Administration/\344\275\277\347\224\250hostnamectl\351\205\215\347\275\256\344\270\273\346\234\272\345\220\215.md" @@ -52,8 +52,8 @@ 在远程系统中运行hostnamectl命令时,要使用-H,--host 选项,使用如下命令: ``` -# hostnamectl set-hostname -H [username]@hostname +# hostnamectl set-hostname -H [username]@hostname new_hostname ``` -其中hostname是要配置的远程主机,username为自选项,hostnamectl会通过SSH连接到远程系统。 +其中hostname是要配置的远程主机,username为自选项,new\_hostname为新主机名。hostnamectl会通过SSH连接到远程系统。 diff --git "a/content/zh/docs/Administration/\344\275\277\347\224\250nmcli-1.md" "b/content/zh/docs/Administration/\344\275\277\347\224\250nmcli-1.md" index f8e4453..1a033cc 100644 --- "a/content/zh/docs/Administration/\344\275\277\347\224\250nmcli-1.md" +++ "b/content/zh/docs/Administration/\344\275\277\347\224\250nmcli-1.md" @@ -3,7 +3,7 @@ - 创建名为mybond0的绑定,使用示例如下: ``` - # nmcli con add type bond con-name mybond0 ifname mybond0 mode activebackup + # nmcli con add type bond con-name mybond0 ifname mybond0 mode active-backup ``` - 添加从属接口,使用示例如下: diff --git "a/content/zh/docs/Administration/\345\205\263\351\227\255-\346\232\202\345\201\234\345\222\214\344\274\221\347\234\240\347\263\273\347\273\237.md" "b/content/zh/docs/Administration/\345\205\263\351\227\255-\346\232\202\345\201\234\345\222\214\344\274\221\347\234\240\347\263\273\347\273\237.md" index e5fbeb6..38279f9 100644 --- "a/content/zh/docs/Administration/\345\205\263\351\227\255-\346\232\202\345\201\234\345\222\214\344\274\221\347\234\240\347\263\273\347\273\237.md" +++ "b/content/zh/docs/Administration/\345\205\263\351\227\255-\346\232\202\345\201\234\345\222\214\344\274\221\347\234\240\347\263\273\347\273\237.md" @@ -2,12 +2,12 @@ ## systemctl命令 -systemd通过systemctl命令可以对系统进行关机、重启、休眠等一系列操作。当前仍兼容Linux常用管理命令,对应关系如[表1](#zh-cn_topic_0151920964_t3daaaba6a03b4c36be9668efcdb61f3b)。建议用户使用systemctl命令进行操作。 +systemd通过systemctl命令可以对系统进行关机、重启、休眠等一系列操作。当前仍兼容部分Linux常用管理命令,对应关系如[表1](#zh-cn_topic_0151920964_t3daaaba6a03b4c36be9668efcdb61f3b)。建议用户使用systemctl命令进行操作。 **表 1** 命令对应关系 -

之前命令

+ @@ -36,27 +36,6 @@ systemd通过systemctl命令可以对系统进行关机、重启、休眠等一 - - - - - - - - - - - -

Linux常用管理命令

systemctl命令

重启

pm-suspend

-

systemctl suspend

-

待机

-

pm-hibernate

-

systemctl hibernate

-

休眠

-

pm-suspend-hybrid

-

systemctl hybrid-sleep

-

缓和休眠模式

-
diff --git "a/content/zh/docs/Administration/\345\210\233\345\273\272\344\273\216\345\261\236\346\216\245\345\217\243.md" "b/content/zh/docs/Administration/\345\210\233\345\273\272\344\273\216\345\261\236\346\216\245\345\217\243.md" index d9405cc..2d0f8e2 100644 --- "a/content/zh/docs/Administration/\345\210\233\345\273\272\344\273\216\345\261\236\346\216\245\345\217\243.md" +++ "b/content/zh/docs/Administration/\345\210\233\345\273\272\344\273\216\345\261\236\346\216\245\345\217\243.md" @@ -5,13 +5,12 @@ 例如将两个网络接口enp3s0 和 enp4s0 以频道方式绑定,其配置文件示例分别如下: ``` - TYPE=Ethernet NAME=bond-slave-enp3s0 UUID=3b7601d1-b373-4fdf-a996-9d267d1cac40 DEVICE=enp3s0 ONBOOT=yes -MASTER=bond000000 +MASTER=bond0 SLAVE=yes ``` @@ -21,7 +20,7 @@ NAME=bond-slave-enp4s0 UUID=00f0482c-824f-478f-9479-abf947f01c4a DEVICE=enp4s0 ONBOOT=yes -MASTER=bond000000 +MASTER=bond0 SLAVE=yes ``` diff --git "a/content/zh/docs/Administration/\345\221\250\346\234\237\346\200\247\350\277\220\350\241\214\344\270\200\346\211\271\347\250\213\345\272\217\357\274\210cron\357\274\211.md" "b/content/zh/docs/Administration/\345\221\250\346\234\237\346\200\247\350\277\220\350\241\214\344\270\200\346\211\271\347\250\213\345\272\217\357\274\210cron\357\274\211.md" index 6a1ecdf..6d7dca2 100644 --- "a/content/zh/docs/Administration/\345\221\250\346\234\237\346\200\247\350\277\220\350\241\214\344\270\200\346\211\271\347\250\213\345\272\217\357\274\210cron\357\274\211.md" +++ "b/content/zh/docs/Administration/\345\221\250\346\234\237\346\200\247\350\277\220\350\241\214\344\270\200\346\211\271\347\250\213\345\272\217\357\274\210cron\357\274\211.md" @@ -84,18 +84,18 @@ minute hour day-of-month month-of-year day-of-week commands 例如晚上18点到22点之间每两个小时,在/tmp/test.txt文件中加入sleepy文本。在crontab文件中对应的行如下: ``` -* 18-22/2 * * * echo"sleepy" >> /tmp/test.txt +* 18-22/2 * * * echo "sleepy" >> /tmp/test.txt ``` 每次编辑完某个用户的cron设置后,cron自动在/var/spool/cron下生成一个与此用户同名的文件。此用户的cron信息都记录在这个文件中,这个文件是不可以直接编辑的,只可以用crontab -e来编辑。用户也可以另外建立一个文件,使用“cron文件名”命令导入cron设置。 假设有个用户名为globus,它需要为自己创建的一个crontab文件。步骤如下: -1. 首先可以使用任何文本编辑器建立一个新文件,并将向该文件加入需要运行的命令和要定期执行的时间,假发该文件为 \~/globus.cron。 +1. 首先可以使用任何文本编辑器建立一个新文件,并将向该文件加入需要运行的命令和要定期执行的时间,假设该文件为 \~/globus.cron。 2. 然后使用crontab命令安装这个文件,使用crontab命令使之成为该用户的crontab文件。命令如下: ``` - crontab globus. -/globus.cron + crontab globus. ~/globus.cron ``` diff --git "a/content/zh/docs/Administration/\346\224\271\345\217\230\350\277\220\350\241\214\347\272\247\345\210\253.md" "b/content/zh/docs/Administration/\346\224\271\345\217\230\350\277\220\350\241\214\347\272\247\345\210\253.md" index c4bca64..3de3a05 100644 --- "a/content/zh/docs/Administration/\346\224\271\345\217\230\350\277\220\350\241\214\347\272\247\345\210\253.md" +++ "b/content/zh/docs/Administration/\346\224\271\345\217\230\350\277\220\350\241\214\347\272\247\345\210\253.md" @@ -7,61 +7,61 @@ systemd用目标(target)替代了运行级别的概念,提供了更大的 **表 1** 运行级别和systemd目标 -

运行级别

+ - - - - - - - - - - - - - - - - - - @@ -107,10 +107,12 @@ systemctl isolate name.target systemctl rescue ``` -这条命令和“systemctl isolate rescue.target”类似,但它会给当前所有的登录用户发送一条提示消息。如果想避免systemd发送这个消息,您可以添加“--no-wall”参数。具体命令如下: +这条命令和“systemctl isolate rescue.target”类似。命令执行后会在串口有如下打印信息: ``` -systemctl --no-wall rescue +You are in rescue mode. After logging in, type "journalctl -xb" to viewsystem logs, "systemctl reboot" to reboot, "systemctl default" or "exit"to boot into default mode. +Give root password for maintenance +(or press Control-D to continue): ``` >![](public_sys-resources/icon-note.gif) **说明:** @@ -124,10 +126,12 @@ systemctl --no-wall rescue systemctl emergency ``` -这条命令和“systemctl isolate emergency.target”类似,但它会给当前所有的登录用户发送一条提示消息。如果不想让systemd发送该消息,您可以添加“--no-wall”参数。具体命令如下: +这条命令和“systemctl isolate emergency.target”类似。命令执行后会在串口有如下打印信息: ``` -systemctl --no-wall emergency +You are in emergency mode. After logging in, type "journalctl -xb" to viewsystem logs, "systemctl reboot" to reboot, "systemctl default" or "exit"to boot into default mode. +Give root password for maintenance +(or press Control-D to continue): ``` >![](public_sys-resources/icon-note.gif) **说明:** diff --git "a/content/zh/docs/Administration/\346\233\264\346\226\260repo\346\272\220.md" "b/content/zh/docs/Administration/\346\233\264\346\226\260repo\346\272\220.md" index cd99ad4..19af68c 100644 --- "a/content/zh/docs/Administration/\346\233\264\346\226\260repo\346\272\220.md" +++ "b/content/zh/docs/Administration/\346\233\264\346\226\260repo\346\272\220.md" @@ -6,6 +6,7 @@ - 在repo源的Packages目录下添加rpm包,然后更新repo源,可通过createrepo命令更新repo源 ``` + dnf install createrepo createrepo --update --workers=10 /srv/repo ``` diff --git "a/content/zh/docs/Administration/\346\234\211\347\212\266\346\200\201\350\207\252\345\212\250\351\205\215\347\275\256IPv6\345\234\260\345\235\200.md" "b/content/zh/docs/Administration/\346\234\211\347\212\266\346\200\201\350\207\252\345\212\250\351\205\215\347\275\256IPv6\345\234\260\345\235\200.md" index fbb5a6e..4c88c5d 100644 --- "a/content/zh/docs/Administration/\346\234\211\347\212\266\346\200\201\350\207\252\345\212\250\351\205\215\347\275\256IPv6\345\234\260\345\235\200.md" +++ "b/content/zh/docs/Administration/\346\234\211\347\212\266\346\200\201\350\207\252\345\212\250\351\205\215\347\275\256IPv6\345\234\260\345\235\200.md" @@ -72,7 +72,7 @@ IPv6与IPv4都可以通过DHCP的方式获得IP地址。IPv6地址有两种配 服务端使用方法: ``` - dhcpd -6 -cf /etc/dhcp/dhcpd6.conf + dhcpd -6 -cf /etc/dhcp/dhcpd6.conf ``` diff --git "a/content/zh/docs/Administration/\346\246\202\350\277\260.md" "b/content/zh/docs/Administration/\346\246\202\350\277\260.md" index 9483f26..e01af29 100644 --- "a/content/zh/docs/Administration/\346\246\202\350\277\260.md" +++ "b/content/zh/docs/Administration/\346\246\202\350\277\260.md" @@ -1,4 +1,4 @@ # 概述 -将openEuler提供的镜像openEuler-1.0-aarch64-dvd.iso创建为repo源,并使用nginx进行repo源部署,提供http服务。 +将openEuler提供的镜像openEuler-1.0-aarch64-dvd.iso创建为repo源,如下以使用nginx进行repo源部署,提供http服务为例进行说明。 diff --git "a/content/zh/docs/Administration/\346\267\273\345\212\240-\345\220\257\347\224\250\345\222\214\347\246\201\347\224\250\350\275\257\344\273\266\346\272\220.md" "b/content/zh/docs/Administration/\346\267\273\345\212\240-\345\220\257\347\224\250\345\222\214\347\246\201\347\224\250\350\275\257\344\273\266\346\272\220.md" index 4bdc464..5bfb800 100644 --- "a/content/zh/docs/Administration/\346\267\273\345\212\240-\345\220\257\347\224\250\345\222\214\347\246\201\347\224\250\350\275\257\344\273\266\346\272\220.md" +++ "b/content/zh/docs/Administration/\346\267\273\345\212\240-\345\220\257\347\224\250\345\222\214\347\246\201\347\224\250\350\275\257\344\273\266\346\272\220.md" @@ -6,7 +6,7 @@ 要定义一个新的软件源仓库,您可以在 /etc/dnf/dnf.conf 文件中添加“repository”部分,或者在/etc/yum.repos.d/目录下添加“.repo”文件进行说明。建议您通过添加“.repo”的方式,每个软件源都有自己对应的“.repo”文件,以下介绍该方式的操作方法。 -要在您的系统中添加一个这样的源,请在root权限下执行如下命令,执行完成之后会在 /etc 目录下生成对应的repo文件。其中_repository\_url _为repo源地址,详情请参见“使用DNF管理软件包 \> 配置DNF \> 修改配置文件”章节中的“repository参数说明”。 +要在您的系统中添加一个这样的源,请在root权限下执行如下命令,执行完成之后会在/etc/yum.repos.d/目录下生成对应的repo文件。其中_repository\_url _为repo源地址,详情请参见“使用DNF管理软件包 \> 配置DNF \> 修改配置文件”章节中的“repository参数说明”。 ``` dnf config-manager --add-repo repository_url diff --git "a/content/zh/docs/Administration/\347\256\241\347\220\206\346\250\241\345\235\227\345\222\214SSL.md" "b/content/zh/docs/Administration/\347\256\241\347\220\206\346\250\241\345\235\227\345\222\214SSL.md" index 310763b..2821a2d 100644 --- "a/content/zh/docs/Administration/\347\256\241\347\220\206\346\250\241\345\235\227\345\222\214SSL.md" +++ "b/content/zh/docs/Administration/\347\256\241\347\220\206\346\250\241\345\235\227\345\222\214SSL.md" @@ -43,5 +43,30 @@ httpd服务是一个模块化的应用,它和许多动态共享对象DSO(Dyn ## SSL介绍 -安全套接层SSL(Secure Sockets Layer)是一个允许服务端和客户端之间进行安全通信的加密协议。其中,传输层安全性协议TLS(Transport Layer Security)为网络通信提供了安全性和数据完整性保障。openEuler支持Mozilla NSS(Network Security Services)作为安全性协议TLS进行配置。 +安全套接层SSL(Secure Sockets Layer)是一个允许服务端和客户端之间进行安全通信的加密协议。其中,传输层安全性协议TLS(Transport Layer Security)为网络通信提供了安全性和数据完整性保障。openEuler支持Mozilla NSS(Network Security Services)作为安全性协议TLS进行配置。加载SSL的操作步骤如下: + +1. 安装mod\_ssl的rpm包。 + + ``` + # dnf install mod_ssl + ``` + +2. 安装完成后,请重启httpd服务以便于重新加载配置文件。 + + ``` + # systemctl restart httpd + ``` + +3. 加载完成后,使用httpd -M的命令查看是否已经加载了SSL。 + + ``` + # httpd -M | grep ssl + ``` + + 回显如下,说明SSL已加载成功。 + + ``` + ssl_module (shared) + ``` + diff --git "a/content/zh/docs/Administration/\347\256\241\347\220\206\347\263\273\347\273\237\346\234\215\345\212\241.md" "b/content/zh/docs/Administration/\347\256\241\347\220\206\347\263\273\347\273\237\346\234\215\345\212\241.md" index a2f8961..5d7a659 100644 --- "a/content/zh/docs/Administration/\347\256\241\347\220\206\347\263\273\347\273\237\346\234\215\345\212\241.md" +++ "b/content/zh/docs/Administration/\347\256\241\347\220\206\347\263\273\347\273\237\346\234\215\345\212\241.md" @@ -17,65 +17,65 @@ systemd提供systemctl命令与sysvinit命令的功能类似。当前版本中 - - - - - - - - - - - - - - - - - - - @@ -87,14 +87,14 @@ systemd提供systemctl命令与sysvinit命令的功能类似。当前版本中 - - - diff --git "a/content/zh/docs/Administration/\350\216\267\345\217\226ISO\351\225\234\345\203\217.md" "b/content/zh/docs/Administration/\350\216\267\345\217\226ISO\351\225\234\345\203\217.md" index 3fac0a2..7529f5d 100644 --- "a/content/zh/docs/Administration/\350\216\267\345\217\226ISO\351\225\234\345\203\217.md" +++ "b/content/zh/docs/Administration/\350\216\267\345\217\226ISO\351\225\234\345\203\217.md" @@ -1,10 +1,8 @@ # 获取ISO镜像 -openEuler 1.0版本的镜像暂未公开,当前不提供镜像下载链接,获取地址将在镜像正式上线后提供。 - ## 获取包路径 请从如下网址获取openEuler软件包: -openEuler 1.0版本的软件包暂未公开,当前不提供软件包下载链接,获取地址将在软件包正式上线后提供。 +[https://openeuler.org/zh/download.html](https://openeuler.org/zh/download.html) diff --git "a/content/zh/docs/Administration/\350\256\276\347\275\256RAID0\345\215\267-\345\217\202\346\225\260stripsize\350\256\276\347\275\256\344\270\2724\346\227\266\345\207\272\351\224\231.md" "b/content/zh/docs/Administration/\350\256\276\347\275\256RAID0\345\215\267-\345\217\202\346\225\260stripsize\350\256\276\347\275\256\344\270\2724\346\227\266\345\207\272\351\224\231.md" index 8471ce9..a2926df 100644 --- "a/content/zh/docs/Administration/\350\256\276\347\275\256RAID0\345\215\267-\345\217\202\346\225\260stripsize\350\256\276\347\275\256\344\270\2724\346\227\266\345\207\272\351\224\231.md" +++ "b/content/zh/docs/Administration/\350\256\276\347\275\256RAID0\345\215\267-\345\217\202\346\225\260stripsize\350\256\276\347\275\256\344\270\2724\346\227\266\345\207\272\351\224\231.md" @@ -10,5 +10,5 @@ ## 解决方法 -openEuler条带化规格支持的stripesize最小值为64KB,将参数stripesize设置为64。 +不需要修改配置文件,openeuler执行lvcreate命令时,条带化规格支持的stripesize最小值为64KB,将参数stripesize设置为64。 diff --git "a/content/zh/docs/Administration/\351\205\215\347\275\256\345\212\250\346\200\201IP\350\277\236\346\216\245.md" "b/content/zh/docs/Administration/\351\205\215\347\275\256\345\212\250\346\200\201IP\350\277\236\346\216\245.md" index d6782b4..5033497 100644 --- "a/content/zh/docs/Administration/\351\205\215\347\275\256\345\212\250\346\200\201IP\350\277\236\346\216\245.md" +++ "b/content/zh/docs/Administration/\351\205\215\347\275\256\345\212\250\346\200\201IP\350\277\236\346\216\245.md" @@ -39,18 +39,3 @@ lo loopback unmanaged -- virbr0-nic tun unmanaged -- ``` -更改主机发送到 DHCP 服务器的主机名,则需要修改 dhcp-hostname 属性,使用如下命令: - -``` -# nmcli con modify net-test net-test ipv4.dhcp-hostname host-name ipv6.dhcp-hostname host-name -``` - -更改主机发送到 DHCP 服务器的 IPv4 客户端 ID,需要修改 dhcp-client-id 属性,使用如下命令: - -``` -# nmcli con modify net-test net-test ipv4.dhcp-client-id client-IDstring -``` - ->![](public_sys-resources/icon-note.gif) **说明:** ->当前没有用于 IPv6 的 dhcp-client-id 属性,dhclient 为 IPv6 生成识别符。详细说明请查看 dhclient\(8\) manpage。 - diff --git "a/content/zh/docs/Administration/\351\235\231\346\200\201\350\267\257\347\224\261\345\217\212\351\273\230\350\256\244\347\275\221\345\205\263.md" "b/content/zh/docs/Administration/\351\235\231\346\200\201\350\267\257\347\224\261\345\217\212\351\273\230\350\256\244\347\275\221\345\205\263.md" index b094a05..39925f1 100644 --- "a/content/zh/docs/Administration/\351\235\231\346\200\201\350\267\257\347\224\261\345\217\212\351\273\230\350\256\244\347\275\221\345\205\263.md" +++ "b/content/zh/docs/Administration/\351\235\231\346\200\201\350\267\257\347\224\261\345\217\212\351\273\230\350\256\244\347\275\221\345\205\263.md" @@ -20,15 +20,15 @@ default via 192.168.0.1 dev enp4s0 proto dhcp metric 101 192.168.122.0/24 dev virbr0 proto kernel scope link src 192.168.122.1 linkdown ``` -在主机地址中添加一个静态路由,在 root 权限下,使用以下命令: +在主机地址中添加一个静态路由,在 root 权限下,使用以下命令格式: ``` -ip route add 192.168.2.1 via 10.0.0.1 [dev ifname] +ip route add 192.168.2.1 via 10.0.0.1 [dev interface-name] ``` -其中 192.168.2.1 是用点分隔的十进制符号中的 IP 地址,10.0.0.1 是下一个跃点,ifname 是进入下一个跃点的退出接口。 +其中 192.168.2.1 是用点分隔的十进制符号中的 IP 地址,10.0.0.1 是下一个跃点,_interface-name_是进入下一个跃点的退出接口。 -要在网络中添加一个静态路由,即代表 IP 地址范围的 IP 地址,请作为 root 运行以下命令: +要在网络中添加一个静态路由,即代表 IP 地址范围的 IP 地址,请作为 root 运行以下命令格式: ``` ip route add 192.168.2.0/24 via 10.0.0.1 [dev interface-name] -- GitLab

运行级别

systemd目标(target)

+

systemd目标(target)

描述

0

+

0

runlevel0.target,poweroff.target

+

runlevel0.target,poweroff.target

关闭系统。

1

+

1, s, single

runlevel1.target,rescue.target

+

runlevel1.target,rescue.target

单用户模式。

2

+

2, 4

runlevel2.target,multi-user.target

+

runlevel2.target,runlevel4.target,multi-user.target

用户定义/域特定运行级别。默认等同于3。

3

+

3

runlevel3.target,multi-user.target

+

runlevel3.target,multi-user.target

多用户,非图形化。用户可以通过多个控制台或网络登录。

4

+

5

runlevel4.target,multi-user.target

+

runlevel5.target,graphical.target

用户定义/域特定运行级别。默认等同于3。

+

多用户,图形化。通常为所有运行级别3的服务外加图形化登录。

5

+

6

runlevel5.target,graphical.target

+

runlevel6.target,reboot.target

多用户,图形化。通常为所有运行级别3的服务外加图形化登录。

+

重启系统。

6

+

emergency

runlevel6.target,reboot.target

+

emergency.target

重启系统。

+

紧急Shell

service sshd start

+

service network start

systemctl start sshd.service

+

systemctl start network.service

用来启动一个服务 (并不会重启现有的)。

service sshd stop

+

service network stop

systemctl stop sshd.service

+

systemctl stop network.service

用来停止一个服务 (并不会重启现有的)。

service sshd restart

+

service network restart

systemctl restart sshd.service

+

systemctl restart network.service

用来停止并启动一个服务。

service sshd reload

+

service network reload

systemctl reload sshd.service

+

systemctl reload network.service

当支持时,重新装载配置文件而不中断等待操作。

service sshd condrestart

+

service network condrestart

systemctl condrestart sshd.service

+

systemctl condrestart network.service

如果服务正在运行那么重启它。

service sshd status

+

service network status

systemctl status sshd.service

+

systemctl status network.service

汇报服务是否正在运行。

+

检查服务运行状态

chkconfig sshd on

+

chkconfig network on

systemctl enable sshd.service

+

systemctl enable network.service

在下次启动时或满足其他触发条件时设置服务为启用。

chkconfig sshd off

+

chkconfig network off

systemctl disable sshd.service

+

systemctl disable network.service

在下次启动时或满足其他触发条件时设置服务为禁用。

chkconfig sshd

+

chkconfig network

systemctl is-enabled sshd.service

+

systemctl is-enabled network.service

用来检查一个服务在当前环境下被配置为启用还是禁用。

输出在各个运行级别下服务的启用和禁用情况。

chkconfig sshd --list

+

chkconfig network --list

ls /etc/systemd/system/*.wants/sshd.service

+

ls /etc/systemd/system/*.wants/network.service

用来列出该服务在哪些运行级别下启用和禁用。

chkconfig sshd --add

+

chkconfig network --add

systemctl daemon-reload