Show Table of Contents
3.2. 使用文本用户界面 nmtui 配置主机名
可在终端窗口中使用文本用户界面工具 nmtui 配置主机名。运行下面的命令启动该工具:
~]$ nmtui
此时会出现文本用户界面。输入错误命令时会显示用法信息。

图 3.1. NetworkManager 文本用户界面启动菜单
导航时,使用箭头键或按 Tab 键在选项中前进,按 Shift+Tab 组合键后退。按 Enter 键选择一个选项。按 Space 键切换选择框状态。
有关安装 nmtui 的详情,请查看 第 1.5 节 “使用文本用户界面(nmtui)进行网络配置”。
可使用 NetworkManager 文本用户界面工具 nmtui 在
/etc/hostname 文件中查询和设置 static 主机。注:写入时,hostnamectl 不会意识到采用这个方法更改的主机名。
要强制 hostnamectl 注意这个 static 主机名更改,请作为
root 用户重启 hostnamed:
~]# systemctl restart systemd-hostnamed

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.