LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Computer Name, can it be changed? (https://www.linuxquestions.org/questions/linux-newbie-8/computer-name-can-it-be-changed-62826/)

Aldyn 05-31-2003 12:53 AM

Computer Name, can it be changed?
 
I just installed redhat 9.0 hoping it would fix a networking issue I had with 8.0.

With the 9.0 installation, i didn't notice any screen to enter my computers name, or add users for that matter. The latter doesn't matter, I can do that manually, but what I'd really like to be able to rename my computer.

Right now its set to some mess like x1-6-00-f4-2c-62-8f or some nonsense.

Any help would be appreciated. Thanks

James Meyer
aka Aldyn

P.S. Its running a Server install, so there is no X-windows or anything graphical. So please only post solutions that will work from the command line.

Thanks again

Crashed_Again 05-31-2003 12:57 AM

If you want to change the hostname then do:

hostname ThisIsMyServer

Is that what you are looking for?

Aldyn 05-31-2003 01:09 AM

No, that didn't seem to do it.

For example. Right now when I book up at the console, it says:

Red Hat Linux release 9 (Shrike)
Kernel 2.4.20-8 on an i686

x1-6-00-40-f402c06208f login:

I was this ^ to be something else.

The redhat 8.0 installation let me choose a name, but the 9.0 installation didn't seem to. I am just wondering if I can change it.

Because when I log in, I also have:

[user@x1-6-00-40-f402c06208f user]#

as the prompt, which is a bit long and spammy, and just plain ugly, i think.

Thanks again.

fancypiper 05-31-2003 01:13 AM

Create a file /etc/hostname and put one word in it, your hostname and a newline (enter key pressed after the word).

You may have to add it to your /etc/hosts file as well. Here is mine for an example:
Code:

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1      uilleann        localhost.localdomain  localhost
192.168.0.1    uilleann
192.168.0.2    tinwhistle
192.168.0.3    bones

# Redhat links
RedHat Linux Manuals
Maximum RPM
rpmfind
Easier software management: apt4rpm - Red Carpet
RedHat 8.0 Tips & Tricks

# Redhat 7.3 down configuration commands
setup leads to several configuration tools

# Redhat 7.3 up configuration commands
Configure soundcard:
redhat-config-soundcard
Configure X server:
redhat-config-xfree86
Configure network:
redhat-config-network

# Redhat 9.0
Redhat 9.0 Upgrading the kernel
Building a custom kernel

Aldyn 05-31-2003 01:17 AM

Tried both, no luck.

I found out though that if I do

uname -n

It shows up as that, which is the nodename or something.

If that helps.

James

Crashed_Again 05-31-2003 01:31 AM

Check out the 'nodename' command. I don't know if you want to change that value though. Not sure what it is exactly. If your just worried about the prompt then change your PS1 value:

PS1="What is thy bidding? "

dennisa 05-31-2003 05:06 AM

Have a look at /proc/sys/kernel/hostname
 
Try 'cat /proc/sys/kernel/hostname'. If it shows x1-6-00-40-f402c06208f then write 'echo "MyNewComputerName" >/proc/sys/kernel/hostname'.

What do you get with 'uname -n' and 'echo $PS1'?

Hope that helps

Aldyn 05-31-2003 10:43 AM

Dennisa:

No, still no luck, but what it did do it prevent MySQL and HTTPD from initializing on boot up.

Crashed_Again:

I can't seem to find the nodename command. And its not just the prompt I'm worried about. The computer name comes up in a variety of actions and commands. And that long string is large nuisance compared to a shorter name.

I'm going to try a reinstall and see if perhaps I just missed a screen or something.

I'll let you all know how it went.

Crashed_Again 05-31-2003 11:24 AM

Bah! Giving up so soon? If you 'man hostname' you will see the nodename command in there. If you were feeling adventurous you could grep for that string:

grep -R x1-6-00-40-f402c06208f /etc/*

It may take a little bit but I'm sure you'd find what you are looking for.

Aldyn 05-31-2003 11:41 AM

Heh, not giving up, I'm checking too see if i missed a screen. After installing again, I now know I didn't, so its back to the grind.

Got it figured out.

I just changed a line in
/etc/sysconfig/network

Thanks for all your help though. Its much appreciated.


All times are GMT -5. The time now is 07:07 AM.