CentOS7如何临时和永久修改计算机名

电脑知识 投稿 103800 0 评论

CentOS7如何临时和永久修改计算机名

Centos 7 安装完成默认计算机名feishuai

临时修改:

运行命令

sudo hostname feishuai
hostname

显示hostname 已修改为feishuai

但是重启失效

永久修改方法1:

运行命令

hostnamectl set-hostname feishuai
hostname

显示已修改为feishuai

reboot

重启后依然生效

永久修改方法2:

运行命令

sudo vim/etc/hostname

修改行 localhost 为 feishuai

:wq!

保存退出

reboot

重启后依然生效

编程笔记 » CentOS7如何临时和永久修改计算机名

赞同 (205) or 分享 (0)
游客 发表我的评论   换个身份
取消评论

表情
(0)个小伙伴在吐槽