How to change my computer name?
Hi All,
I'm very new to linux. Now I'm using RHEL5. After installed, I want to change my computer name. Please help me to find out solution. Thx. Jalone |
Welcome to LQ
Here's a link to one of the 28,000,000 hits I got on Google regarding this subject: http://www.cyberciti.biz/faq/linux-s...-of-my-server/ |
Code:
[fedora@localhost ~]$ hostname |
You should find the hostname (and be able to change it permanently) by editing /etc/sysconfig/network and restarting your network service.
|
Hi All,
thanks for ur quicky reply. Now I already change the hostname by using root account. But when I open my terminal, promt me as user@master:~ (now I'm using user account.) so what is the master? I think should be " user@hostname:~" Is the right one? Jalone |
Hi all,
I think I need to restart network service. How do I restart the networking service? Thanks Jalone |
How did you change it?
You may need to change it via the hostname command for command prompts to change without rebooting. |
If you want to change your host's name to station1, then:
1.log in as root user 2. vi /etc/sysconfig/network HOSTNAME=station1 2b.save the file. 3.log out and log in, now you can see that it has gotten changed as you wished and it will not change even in successive reboots, because you have entered this in /etc/sysconfig/network file: 4.[root@station1~]# hostname station1 5.It is always good to enter this hostname in /etc/hosts file: 6.vi /etc/hosts 127.0.0.1 station1 localhost.localdomain localhost 7. If you want to change your hostname temporarily, just type: hostname stationX, but this will change to station1 once you reboot your system...!! |
Could check my Blog post on Setting the Linux Hostname so you won't miss anything or skip any steps.. this also includes info on changing the name on the fly without a reboot.
props to the cpqlinux site where I obtained the info. |
Hi saagar and all,
Thanks for all replies. Now the terminal prompt me as [ user@mystation:~]. Finally successful. |
All times are GMT -5. The time now is 10:48 AM. |