LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   what trouble will there be changing hostname (https://www.linuxquestions.org/questions/linux-newbie-8/what-trouble-will-there-be-changing-hostname-241333/)

the_rhino 10-11-2004 10:23 AM

what trouble will there be changing hostname
 
What trouble will I cause if I change the hostname to something other than localhost?

I have 3 boxes with different versions of the same flavor or different flavors of Linux. It becomes confusing trying to remember which box I am actually working on when I am in the shell because all of them have the same user account and the hostname localhost.

Are there others ways to identify the boxes that would be better to use?

I can go to my router and see what IP addresses have been asigned but the names of the boxes have useless name information next to the IP address asigned to each. I can then login as su - and run ifconfig to see what the IP address is on each box. Both of these methods work but are too time consuming.

If it will not cause trouble with other operations or packages on the box, I will do;

# hostname <new_name>

Any of you experienced Linux users have any good advise before I learn the hardway?

secesh 10-11-2004 11:54 AM

1) your hostname is not localhost! localhost is loopback

-- look at /etc/hosts, and you should see localhost associated with 127.0.0.1.

as far as easy identification, i would suggest modifying your shell prompt.

dsegel 10-11-2004 12:32 PM

You can safely change the hostname with the 'hostname' command, but you may have to update some config files as well.

What is the current hostname? Try just typing 'hostname' with no parameters.

And put something like this at the bottom of your .bashrc for each user:

PS1='\[\033[01;30m\]\u@\h \[\033[01;34m\]\W \$ \[\033[00m\]'

Then you'll have a prompt like this:

daniel@cyril etc $

where the user is daniel, the system is cyril, and the current directory is /etc.


All times are GMT -5. The time now is 03:29 PM.