Horje
how to change hostname in ubuntu Code Example
how to change hostname in ubuntu
#1- Delete the old name and setup new name
sudo hostnamectl set-hostname newHostname

#2- Edit the /etc/hosts file:
sudo nano /etc/hosts

#3- Reboot the system 
sudo reboot

#4- To check the new hostname
hostnamectl
linux change hostname
sudo nano /etc/hostname
sudo nano /etc/hosts
sudo reboot
change username ubuntu
# -l changes login name
# -d changes home directory
# -m copies over contents from old home directory
usermod -l <newname> -d /home/<newname> -m <oldname>

# NOTE: will not work if you are currently logged on as user
# - workaround by temporarily enabling root account and running above command there
# [sudo passwd root] 
# - after root account has been used to change username lock it using
# [sudo passwd -l root]




Shell

Related
check os type linux Code Example check os type linux Code Example
rename computer ubuntu 20.04 Code Example rename computer ubuntu 20.04 Code Example
update composer ubuntu Code Example update composer ubuntu Code Example
linux how to get fqdn Code Example linux how to get fqdn Code Example
how to start psql in linux Code Example how to start psql in linux Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
13