Software projects/OS/Slackware/Advanced usage/Hostname

From Pandora Wiki
Revision as of 14:51, 1 November 2013 by Linux-SWAT (talk | contribs) (Changing the hostname)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Changing the hostname

  • As root, type:
netconfig
  • Now you have to edit /etc/sudoers . You have to use visudo or nano, otherwise some editors may change the permissions of this file, therefore disable sudo commands.
nano /etc/sudoers
  • Change all "darkstar" into the hostname you've choosen.
  • You can do that simply with sed:
sed -i -e "s/darkstar/new-name/" /etc/sudoers
  • Sudoers permissions _must_ be:
ls -lsa /etc/sudoers
-r--r----- 1 root root
  • In case you changed the permissions, do this:
chmod 0440 /etc/sudoers
chown 0.0 /etc/sudoers