SSH in to your debian server
ssh userName@your-server.ip.address or domain name
CHANGE HOSTN NAME IN HOSTS FILE
Using your favourite editor for linux terminal ( mine is nano, easy to use)
nano /etv/hosts
Once you execute the command you will see below file in edit mode.
Second line after the local loop IP agh is my current hostname, you can change it to whatever you desire.
Another syntax that can be used to change the hostname is below
nano /etc/hostname
change the name to your liking
Another syntax that can be used to change the hostname is below
hostnamectl sethostname NEW_HOST_NAME
Finally view your change or updated hostname by typing the following syntax in the terminal
hostname
OR
hostnamectl
Enjoy…
Previous Post