Changing hostname using "hostname" breaks sudo
Bug #113778 reported by
Yann Hamon
This bug report is a duplicate of:
Bug #32906: sudo fails if it cannot resolve the local hostname and no MTA is installed.
Edit
Remove
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
hostname (Ubuntu) |
Incomplete
|
Undecided
|
Massimo Forti |
Bug Description
When trying to change the hostname via the command hostname:
# sudo hostname newhost
The /etc/hostname file is updated, but...
root@newhost:~# sudo vi /etc/hosts
sudo: unable to lookup roller via gethostbyname()
You get this error. It means trying to change the hostname with the hostname command completely breaks your sudo.
To solve this you have to edit your /etc/hosts file and add your new hostname at the end of the 127.0.1.1 line.
Changed in hostname: | |
assignee: | slackwarelife → nobody |
Changed in hostname: | |
assignee: | nobody → slackwarelife |
To post a comment you must log in.
In fact it doesn't change the /etc/hostname neither, I don't know the file hostname actually changes.