Suddenly, my machine changed its hostname for unknown reason. I want to set the previous hostname. I can change hostname, very easily temporarily but not permantly!
when I say hostname I mean the word that it appears at terminal after username eg.
username@hostname :~$
What I did:
- added
"kernel.hostname = name" in /etc/sysctl.conf
- no change after reboot. echo 'name' > /proc/sys/kernel/hostname
only temporarily change ithostnamectl set-hostname name
only temporarily change itsudo hostname name
only temporarily change itcat /etc/hostname
already contains "name"sudo sysctl -w kernel.hostname=name
- no change after reboot.
problems if change temporarily hostname from terminal when using sudo
Authorization required, but no authorization protocol specified
- without changing current hostname system output
cannot connect to display:0
. This message is gone when I change (temporarily) hostname to the proper hostname. I believe somehow system has kept my previous hostname and it conflicts.
so, until now, i am out of options. any suggestion?