i have two machine, both are same version rhel6.4
serverB, installed the server by default hostname, localhost.localdomain
hostname -s
localhost
hostname
localhost.localdomain
can i change the hostname without edit /etc/sysconfig/network
because my serverA, i change the hostname during installation.
/etc/sysconfig/network is showing hostname=localhost.localdomain, but when i type hostname, i
I tried to change my hostname according to this guide for Debian based system:
I edited /etc/hostname file
run /etc/init.d/hostname start
Though there are errors. Always when I write a sudo command it tells me it can't recognize hostname. After I restarted the system, graphical environment wasn't working, startx command wasn't successful.
I have a virtual server running Debian Squeeze. I can change the hostname by running the hostname new.host.name command or by editing /etc/hostname and then running /etc/init.d/hostname.sh, but after a reboot the hostname will be reset to the preconfigured hostname chosen by the server-hoster.
On CentOS (5.x) I have a VPS that has hostname set to "olddomain.com", at least this is the domain I am getting when typing "hostname" command.
I want to change it to 'localhost.localdomain' because I think it is more generic and reliable.
localhost.localdomain already exists in these files: /etc/sysconfig/network AND /etc/hosts
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=localhost.localdomain
G
When I try to edit my /etc/hostname file, using: sudo nano /etc/hostname (or any other editor) I get the following: Error writing /etc/hostname: Permission denied
I then tried to: sudo chmod u+w ./hostname
and got the error:
chmod: changing permissions of `./hostname': Operation not permitted
I get the same error trying to add write permissions to any use or group.
This is what ls show:
-rw-r--r
I've already tried changing the hostname by editing both:
/etc/hostname
/etc/hosts
However when I try to use sudo it doesn't work. I have to restart the computer to make sudo work again.
going step by step through the hostname bit of the startx script, it appears that, with a random hostname, `hostname -f` hangs indefinitely. Setting this simply to `hostname`lets X start up without a hiccup, but it does seem to interfere with sudo to some extent. I attempted to run netcfg (and I have the appropriate 'NOPASSWD' line in my sudoers file), and it asked me for my password.
I'm making some large-scale system hostname changes and this got me thinking...
Linux terminal showing hostname dhcppc4 that i never configured.