• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

VPS and Server

  • Home
  • Web Hosting
  • Dedicated Servers
  • vps hosting
You are here: Home / Operating Systems / Changing Hostname, root password in Ubuntu

Changing Hostname, root password in Ubuntu

June 5, 2024 by VnS Leave a Comment

A very common aspect after getting a dedicated or virtual server provisioned, is to change hostname for many good reasons including publishing it worldwide as a pretty name for internet as well to keep reminding a machine by its assigned name instead of IPs.

Also it is important to change the password of your server once you got it from your provider to make it secure for you.

There are few steps which will let you know how you can perform both jobs quite easily in Linux Ubuntu.

Change Hostname

First of all you need to get ssh access as root

Below Simple command will let you know what is your current hostname as well as the Virtualization Type whether it is KVM or OpenVZ7 etc.

# hostnamectl

Next you will insert below command to edit / change your hostname

# sudo hostnamectl set-hostname my.hostname.com

You can replace “my.hostname.com” with whatever you want to update your own hostname.

Change root Password

If you are not login as root user, you can use below command to change password, enter your password twice for confirmation.

# sudo passwd root

If you are already login to ssh as root user or converted to root, you can achieve password changing goal by simply inserting below command.

# passwd

Filed Under: Operating Systems

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Recent Posts

  • Block IP range / port to access other server using Firewall CSF
  • Changing Hostname, root password in Ubuntu
  • Zip / unzip big folders / files linux | cPanel
  • Very basics of MYSQL Commands
  • Dumping / Restoring Large Mysql Databases

Copyright © 2025 | VPS & SERVER