当前位置: 技术问答>linux和unix
如何把主机名改回去
来源: 互联网 发布时间:2015-07-07
本文导语: 小弟我在安装的时候错误地设置了主机名,导致每次登录都会显示什么无法查到互联网地址,甚烦,请问如何才能把主机名去掉(也就是默认的那种) 我用gedit修改过/etc/sysconfig/network,但再用vi打开就会显示 E325: ATTENTION Found...
小弟我在安装的时候错误地设置了主机名,导致每次登录都会显示什么无法查到互联网地址,甚烦,请问如何才能把主机名去掉(也就是默认的那种)
我用gedit修改过/etc/sysconfig/network,但再用vi打开就会显示
E325: ATTENTION
Found a swap file by the name "/etc/sysconfig/.network.swp"
owned by: root dated: Sun Jul 25 12:39:34 2004
file name: /etc/sysconfig/network
modified: YES
user name: root host name: ATHLONKNIGHT
process ID: 13477
While opening file "/etc/sysconfig/network"
dated: Sun Jul 25 12:51:42 2004
NEWER than swap file!
(1) Another program may be editing the same file.
If this is the case, be careful not to end up with two
different instances of the same file when making changes.
Quit, or continue with caution.
(2) An edit session for this file crashed.
If this is the case, use ":recover" or "vim -r /etc/sysconfig/network"
to recover the changes (see ":help recovery").
If you did this already, delete the swap file "/etc/sysconfig/.network.swp"
to avoid this message.
"/etc/sysconfig/network" 2L, 25C
文件好像是改了,但登录还是有问题,赐教(我不要什么主机名了,能恢复默认就行)
我用gedit修改过/etc/sysconfig/network,但再用vi打开就会显示
E325: ATTENTION
Found a swap file by the name "/etc/sysconfig/.network.swp"
owned by: root dated: Sun Jul 25 12:39:34 2004
file name: /etc/sysconfig/network
modified: YES
user name: root host name: ATHLONKNIGHT
process ID: 13477
While opening file "/etc/sysconfig/network"
dated: Sun Jul 25 12:51:42 2004
NEWER than swap file!
(1) Another program may be editing the same file.
If this is the case, be careful not to end up with two
different instances of the same file when making changes.
Quit, or continue with caution.
(2) An edit session for this file crashed.
If this is the case, use ":recover" or "vim -r /etc/sysconfig/network"
to recover the changes (see ":help recovery").
If you did this already, delete the swap file "/etc/sysconfig/.network.swp"
to avoid this message.
"/etc/sysconfig/network" 2L, 25C
文件好像是改了,但登录还是有问题,赐教(我不要什么主机名了,能恢复默认就行)
|
/etc/hosts文件要改
/etc/sysconfig/network也要改
vi的问题:把.network.swap文件删除掉就行了
/etc/sysconfig/network也要改
vi的问题:把.network.swap文件删除掉就行了
|
vi etc/hosts
|
下面的提示不是说得挺清楚的吗,照办就是了。
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。