Linux-在CLI中更改主机名 [英] Linux - change the hostname in the CLI

查看:101
本文介绍了Linux-在CLI中更改主机名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道如何搜索,这就是为什么我要它(我的所有搜索都没有显示任何相关信息).

I don't know how to search for this and that is why I asked for it (all my searches did not reveal any relevant information).

我有一台Fedora 18服务器,如下所示:

I have a Fedora 18 server that looks like this:

[root@dhcp-192-168-5-100 ~]#

我想将其更改为:

[root@server1 ~]#

当前,该计算机设置为通过DHCP获取IP,但这不是计算机的IP地址,这就是为什么我需要将CLI更改为更相关的内容.

Currently, this machine is set to get IP through DHCP, but that is not the IP address of the machine and that is why I need to change the CLI to something more relevant.

谢谢

推荐答案

,您可以键入主机名HOSTNAME",其中HOSTNAME是所需的新名称.下次登录/通过ssh连接时,将看到此内容.

you can type "hostname HOSTNAME" where HOSTNAME is the new name you want. The next time you log in / connect via ssh, that's what you'll see.

这篇关于Linux-在CLI中更改主机名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆