Home > System Tutorial > LINUX > body text

How to change the host name of Ubuntu? Ubuntu hostname modification guide

王林
Release: 2024-01-05 13:27:24
forward
2546 people have browsed it

1. Enable root user

Run the command sudo passwd root to set the password for the root user

2. Log in as root user

1) Edit the file /etc/hosts and change the following line

127.0.1.1 xxxxx

Replace

with

127.0.1.1 newhostname

2) Edit the /etc/hostname file, delete all contents of the file, and add newhostname

3) Run the command hostname newhostname

3. Exit the root user and log in as a normal user

Note:

where xxxxx is the original host name and newhostname is the host name you want to modify

The above is the detailed content of How to change the host name of Ubuntu? Ubuntu hostname modification guide. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:jb51.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!