How To Change Hostname (Computer Name) On Ubuntu Linux Terminal

Тәжірибелік нұсқаулар және стиль

In this video, I will show you how to change your Ubuntu Linux virtual private server (VPS) hostname or computers name through terminal. A hostname is the name of your device used to identify it over a network. This name is usually user generated and set by you. There is an exception to this, and that is if you setup a cloud server and run with the default hostname set by the hosting provider, during the servers spin up and operating systems installation. The default names generated by your hosting provider, are often long and have all the specs of the VPS you deployed. Therefore, if you have created multiple cloud servers and kept the default hostname generated by the cloud host, it can become tedious as server will have duplicate names. For organisational purposes, it is therefore imperative for each server to have it's own unique name.
Get $200 in cloud credits from DigitalOcean using my referral link: digitalocean.pxf.io/c/1245219...
Steps To Change Host Hostname On Ubuntu Linux Terminal:
1. If you want to change the hostname of your cloud server, first log into your server via SSH. If you want to change your Ubuntu Linux computer's hostname. simply open up terminal
2. Type the following command if you're logged in as root:
nano /etc/hostname
If you're logged in as sudo user, type the following command instead:
sudo nano /etc/hostname
3. Edit the default hostname for your VPS or computer
4. Press Ctrl+O on your keyboard to save the changes you just made to your hostname file
5. Press Enter on your keyboard
6. Press Ctrl+X to close out of nano
7. Now, to see the changes take effect, you must reboot or restart your system by typing the following command:
reboot now
If you're logged in as sudo user, type the following command instead:
sudo reboot now
8. Log back into your cloud server or computer and now you should see the new host name reflected in terminal.
9. [Optional] If you changed the hostname of your VPS, it's good practice to also change the hostname of your cloud server in your hosting providers dashboard.
Congratulations, you have successfully changed your cloud servers hostname or computer name through the Ubuntu Linux terminal.
Timestamps:
0:00 - Intro & Context
0:53 - Change Hostname On Ubuntu Linux Terminal
2:31 - Reboot Cloud Server or Computer
4:04 - Change Hostname In Cloud Hosting Providers Dashboard
4:33 - Closing & Outro
Grow your KZread Channel with vidIQ vidiq.com/70s
Ubuntu Linux Tutorials (Playlist) • Ubuntu Linux Tutorials
More DigitalOcean Server Guides (Playlist) • DigitalOcean Cloud Com...
Social Media
SUBSCRIBE www.youtube.com/@Websplaining...
Instagram (Thumbnail Collection) / websplaining
Twitter (For Newest uploads) / websplaining
Reddit (Discussions) / websplaining
Personal Website www.websplaining.com
#ChangeHostName #HostName #ChangeLinuxComputerName
DONT FORGET TO LIKE, COMMENT, AND SUBSCRIBE!

Пікірлер: 3

  • @Websplaining
    @Websplaining Жыл бұрын

    Get $200 in cloud credits from DigitalOcean using my referral link: digitalocean.pxf.io/c/1245219/1373759/15890

  • @kadaliakshay6770
    @kadaliakshay67707 ай бұрын

    Error writing /etc/hostname: Permission denied

Келесі