位置: 编程技术 - 正文

CentOS7的hostnamectl命令使用详解

编辑:rootadmin

推荐整理分享CentOS7的hostnamectl命令使用详解,希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:,内容如对您有帮助,希望把文章链接给更多的朋友!

centos7 上在主机名变更新增了一个hostnamectl 指令 ,该指令的无论在输出和更改上都较之前更加的便利。先看下hostname的help帮助信息:复制代码代码如下:[root@way ~]# hostnamectl --helphostnamectl [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 hostCommands: 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信息复制代码代码如下:[root@way ~]# hostnamectl Static hostname: way Icon name: computer-desktop Chassis: desktop Machine ID: f5fed0bcaede Boot ID: e0dbc2a3acdab Operating System: CentOS Linux 7 (Core) CPE OS Name: cpe:/o:centos:centos:7 Kernel: Linux 3..0-.6.3.el7.x_ Architecture: x_设置主机名

从上面的help 帮助里可以看到,在设置主机名时,这里涉及到四种主机名,在hostnamectl 的man手册里给予了说明和解释,如下:

CentOS7的hostnamectl命令使用详解

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

一般情况下都是使用set-hostname进行更改:复制代码代码如下:[root@way ~]# hostnamectl set-hostname blog更改主机名一般会涉及到/etc/hostname 、/etc/machine-info 两个文件,同时对于不同的名字修改在man手册上也给了说明:

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 设置的主机一般和图形界面会用到,对应的hostnamectl 输出中的Icon name ,set-chassis 指定了主机的平台类型,如本机的是desktop,还可以设置为:"desktop", "laptop", "server", "tablet", "handset"

在CentOS系统中安装quota来管理磁盘配额 在网络管理的工作中,由于硬盘的资源是有限的,常常需要为多用户的服务器设定用户的linux磁盘配额。这个功能对公用的多用户服务器(免费的或者收

在基于Xen的CentOS系统VPS上配置PPTP VPN的教程 在访问国外网站的时候,速度不是那么理想,可以在自己的vps上建立vpn服务器,方便自己使用,下面是配置pptpd一点经验vps需要是xen的,需要内核支持mppe。

CentOS上查看系统信息以及配置防火墙的方法 查看系统信息一:查看cpu复制代码代码如下:more/proc/cpuinfo|grep"modelname"grep"modelname"/proc/cpuinfo如果觉得需要看的更加舒服复制代码代码如下:grep"modelname"/proc

标签: CentOS7的hostnamectl命令使用详解

本文链接地址:https://www.jiuchutong.com/biancheng/353518.html 转载请保留说明!

上一篇:CentOS 6.3下Samba服务器的安装与配置方法(图文详解)(centos7 samba服务器搭建)

下一篇:在CentOS系统中安装quota来管理磁盘配额(centos安装选择哪个)

  • 关联企业间借款利息扣除规定
  • 车辆报废做账务处理依据的法规是
  • 个税申报缴费
  • 残保金漏报的财务怎么办
  • 增值税专用发票可以开电子发票吗
  • 雇佣外籍劳工
  • 房屋租赁收入核定征收
  • 高速公路通行费电子发票怎么打印
  • 出租固定资产取得的租金收入属于什么收入
  • 建筑业预交税金怎么计算
  • 供应商货款打折分录
  • 由于生产工艺改进引起建筑物设备陈旧
  • 提供应税服务营改增的应税服务不包括什么
  • 拆迁补偿款使用范围
  • 账本印花税如何申报缴纳
  • 增值税纳税表销售额的填写
  • 销售给个人的货款要走公户吗
  • 房地产开发公司取名
  • 自然人办税服务平台怎么登录和注册
  • 经营周转资金需求
  • 残保金中的工资总额在哪看
  • 应交税费应交增值税明细科目设置
  • 股权转让会计处理
  • 房地产车位收入做账
  • win7系统中如何关闭触摸屏声音
  • 如何用mac制作ppt
  • w10引导修复工具
  • 收到供应商现金怎么入账
  • 增值税检查调整科目还在用吗
  • 工业制品买卖
  • 增值税专用发票上注明的价款含税吗
  • php ajax json
  • 增值税达不到起征点账务处理
  • php stomp
  • php同时使用session和cookie来保存用户登录信息的实现代码
  • 覆盖的盖
  • opencv语句
  • 什么情况下不用割包皮
  • 高新技术企业福利费扣除比例
  • 小规模纳税人应交税费会计分录
  • 小规模纳税人销售商品会计分录
  • 新企业职工工资怎么算
  • 农业种植会计
  • 保证金存款账户需要销户吗
  • centos执行sh
  • 备抵类是什么意思
  • 员工食堂买菜怎么写分录
  • 视同内销账务处理怎么做?
  • 汇算清缴补交所得税的分录
  • 存货周转率越高好还是越低好
  • 小规模纳税人所得税计算
  • 现金日记账年结需要另起一页吗
  • 住房按揭贷款贷20年还剩八年是黄好还是慢慢的还好
  • 工资表明细表
  • 企业建账选择什么会计准则
  • win7开关机时间设置
  • 电脑蓝屏bios设置教程
  • linux svn管理工具
  • 微软发布Win10优化工具
  • win7系统设置鼠标灵敏度
  • cocos2djs
  • jquery插件怎么用到自己的网站
  • unity怎么做触屏按键
  • js中写for循环
  • python 详细
  • unity openvr
  • .net 迭代器
  • node项目部署
  • shell脚本特性
  • nodejs示例
  • 什么绑定什么服务
  • [置顶]游戏名:chivalry2
  • javascriptjs
  • javascript怎么做
  • python迭代器iterator
  • 国税局云南省税务局
  • 交错了税可以退吗
  • 个体工商户两处所得,如何减半个税
  • 2008土地管理办法
  • 没工作个人所得税怎么交
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

    网站地图: 企业信息 工商信息 财税知识 网络常识 编程技术

    友情链接: 武汉网站建设