它是用来修改主机名称 -h --help 显示帮助 --version 显示安装包的版本 --transient 修改临时主机名 --static 修改瞬态主机名 --pretty 修改灵活主机名 -P --privileged 在执行之前获得的特权 --no-ask-password 输入密码不提示 -H --host=[USER@]HOST 操作远程主机 Commands: status 显示当前主机名设置 set-hostname NAME 设置系统主机名 set-icon-name NAME 为主机设置icon名 set-chassis NAME 设置主机平台类型名
# hostnamectl # 查看主机名 Static hostname: domain.com Icon name: computer-vm Chassis: vm Machine ID: 35abac74876a48a6ba25974998cf226d Boot ID: e80573c47b914774be58f5560c0d1b49 Virtualization: vmware Operating System: CentOS Linux 7 (Core) CPE OS Name: cpe:/o:centos:centos:7 Kernel: Linux 4.17.11-1.el7.elrepo.x86_64 Architecture: x86-64 # hostnamectl set-hostname jangrui #修改主机名称 # hostnamectl Static hostname: jangrui Icon name: computer-vm Chassis: vm Machine ID: 35abac74876a48a6ba25974998cf226d Boot ID: e80573c47b914774be58f5560c0d1b49 Virtualization: vmware Operating System: CentOS Linux 7 (Core) CPE OS Name: cpe:/o:centos:centos:7 Kernel: Linux 4.17.11-1.el7.elrepo.x86_64 Architecture: x86-64
评论(0)
暂无评论