课程: Linux System Engineer: Networking and SSH
今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Change hostname
- [Instructor] In older versions of Enterprise Linux the host name was stored in slash etc slash sysconfig slash network. This was a very Red Hat-specific place to put it as other distributions used slash etc slash hostname. Now on System D, the host name is stored in slash etc slash hostname, making it more consistent between versions of Linux. However, changing it manually with a text editor is not recommended, as the system doesn't notice automatically. We can change the host name several ways, but the simplest may be with the hostnamectl command. Let's start by checking the default output. In a terminal, type in hostnamectl and hit Enter. This shows the static host name as well as other bits of data. I'm logged into my rhhost1vm, but my host name is still localhost.localdomain. To change the host name, we provide the set dash hostname option. We'll also need to elevate privileges with sudo. Type in clear, and then type in sudo space hostnamectl space set dash hostname space…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。