麻豆小视频在线观看_中文黄色一级片_久久久成人精品_成片免费观看视频大全_午夜精品久久久久久久99热浪潮_成人一区二区三区四区

首頁 > 系統(tǒng) > CentOS > 正文

CentOS7的hostnamectl命令使用詳解

2020-07-08 12:52:14
字體:
供稿:網(wǎng)友

centos7 上在主機(jī)名變更新增了一個(gè)hostnamectl 指令 ,該指令的無論在輸出和更改上都較之前更加的便利。先看下hostname的help幫助信息:

復(fù)制代碼
代碼如下:

[root@361way ~]# hostnamectl --help
hostnamectl [OPTIONS...] COMMAND ...
Query or change system hostname.
-h --help Show this help
--version Show package version
--transient Only set transient hostname
--static Only set static hostname
--pretty Only set pretty hostname
-P --privileged Acquire privileges before execution
--no-ask-password Do not prompt for password
-H --host=[USER@]HOST Operate on remote host
Commands:
status Show current hostname settings
set-hostname NAME Set system hostname
set-icon-name NAME Set icon name for host
set-chassis NAME Set chassis type for host

查看hostname信息

復(fù)制代碼
代碼如下:

[root@361way ~]# hostnamectl
Static hostname: 361way
Icon name: computer-desktop
Chassis: desktop
Machine ID: 6917731f5fe447d0bca296ed2802e250
Boot ID: e0d20bc2a3a4474c960394967d33ab53
Operating System: CentOS Linux 7 (Core)
CPE OS Name: cpe:/o:centos:centos:7
Kernel: Linux 3.10.0-123.6.3.el7.x86_64
Architecture: x86_64

設(shè)置主機(jī)名

從上面的help 幫助里可以看到,在設(shè)置主機(jī)名時(shí),這里涉及到四種主機(jī)名,在hostnamectl 的man手冊(cè)里給予了說明和解釋,如下:

This tool distinguishes three different hostnames: the high-level "pretty" hostname which might include all kinds of special characters (e.g. "Lennart's
Laptop"), the static hostname which is used to initialize the kernel hostname at boot (e.g. "lennarts-laptop"), and the transient hostname which might be
assigned temporarily due to network configuration and might revert back to the static hostname if network connectivity is lost and is only temporarily
written to the kernel hostname (e.g. "dhcp-47-11").
Note that the pretty hostname has little restrictions on the characters used, while the static and transient hostnames are limited to the usually accepted
characters of Internet domain names.
更改主機(jī)名

一般情況下都是使用set-hostname進(jìn)行更改:

復(fù)制代碼
代碼如下:

[root@361way ~]# hostnamectl set-hostname blog

更改主機(jī)名一般會(huì)涉及到/etc/hostname 、/etc/machine-info 兩個(gè)文件,同時(shí)對(duì)于不同的名字修改在man手冊(cè)上也給了說明:

The static hostname is stored in /etc/hostname, see hostname(5) for more information. The pretty hostname, chassis type, and icon name are stored in /etc/machine-info, see machine-id(5).
set-icon-name 設(shè)置的主機(jī)一般和圖形界面會(huì)用到,對(duì)應(yīng)的hostnamectl 輸出中的Icon name  ,set-chassis 指定了主機(jī)的平臺(tái)類型,如本機(jī)的是desktop,還可以設(shè)置為:"desktop", "laptop", "server", "tablet", "handset"

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 亚洲一级电影在线观看 | 草莓福利视频在线观看 | 四季久久免费一区二区三区四区 | 欧美精品一区自拍a毛片在线视频 | 国产老师做www爽爽爽视频 | 精品国产96亚洲一区二区三区 | www.91在线观看 | 宅男视频在线观看免费 | 国产一级小视频 | 2级毛片 | 日本精品婷婷久久爽一下 | 日本免费aaa观看 | 国产69精品久久久久久野外 | 中国嫩模一级毛片 | 黄色av免费电影 | 欧美a视频 | 精品国产一区二区三区四区在线 | 4p一女两男做爰在线观看 | 免费网站看v片在线a | 亚洲一级电影在线观看 | 国产一级毛片a | av免费av| 黄色av一区二区三区 | 久久久久国| 成人电影毛片 | 久久久成人精品视频 | 国产精品中文在线 | 日韩激情| 欧美成人免费香蕉 | 九七在线视频 | 国产老师做www爽爽爽视频 | av中文字幕免费在线观看 | 久草在线资源观看 | 中文字幕h| 曰韩一级片 | 亚洲无线看 | 亚洲人成在线播放网站 | 久久艹逼| 九九黄色 | av在线影片| 国产毛片aaa一区二区三区视频 |