Skip to content

Instantly share code, notes, and snippets.

@aamsur-mkt
Last active September 19, 2023 02:46
Show Gist options
  • Save aamsur-mkt/538de2dae7203eeff0e5c1c44d4c8b51 to your computer and use it in GitHub Desktop.
Save aamsur-mkt/538de2dae7203eeff0e5c1c44d4c8b51 to your computer and use it in GitHub Desktop.
Change ubuntu hostname
$ sudo nano /etc/hosts
# add yourfhostname after localhost
# example :
# 127.0.0.1 localhost yourfhostname
# then save
$ sudo hostnamectl set-hostname yourfhostname
# check the result with:
$ hostname
# The command should return the new hostname.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment