LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-31-2003, 01:53 AM   #1
Aldyn
LQ Newbie
 
Registered: May 2003
Location: Ontario, Canada
Distribution: Redhat 9.0
Posts: 11

Rep: Reputation: 0
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

Last edited by Aldyn; 05-31-2003 at 01:55 AM.
 
Old 05-31-2003, 01:57 AM   #2
Crashed_Again
Senior Member
 
Registered: Dec 2002
Location: Atlantic City, NJ
Distribution: Ubuntu & Arch
Posts: 3,503

Rep: Reputation: 57
If you want to change the hostname then do:

hostname ThisIsMyServer

Is that what you are looking for?
 
Old 05-31-2003, 02:09 AM   #3
Aldyn
LQ Newbie
 
Registered: May 2003
Location: Ontario, Canada
Distribution: Redhat 9.0
Posts: 11

Original Poster
Rep: Reputation: 0
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.
 
Old 05-31-2003, 02:13 AM   #4
fancypiper
LQ Guru
 
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141

Rep: Reputation: 58
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

Last edited by fancypiper; 05-31-2003 at 02:14 AM.
 
Old 05-31-2003, 02:17 AM   #5
Aldyn
LQ Newbie
 
Registered: May 2003
Location: Ontario, Canada
Distribution: Redhat 9.0
Posts: 11

Original Poster
Rep: Reputation: 0
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
 
Old 05-31-2003, 02:31 AM   #6
Crashed_Again
Senior Member
 
Registered: Dec 2002
Location: Atlantic City, NJ
Distribution: Ubuntu & Arch
Posts: 3,503

Rep: Reputation: 57
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? "
 
Old 05-31-2003, 06:06 AM   #7
dennisa
LQ Newbie
 
Registered: May 2003
Location: Sweden
Distribution: Debian
Posts: 3

Rep: Reputation: 0
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
 
Old 05-31-2003, 11:43 AM   #8
Aldyn
LQ Newbie
 
Registered: May 2003
Location: Ontario, Canada
Distribution: Redhat 9.0
Posts: 11

Original Poster
Rep: Reputation: 0
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.
 
Old 05-31-2003, 12:24 PM   #9
Crashed_Again
Senior Member
 
Registered: Dec 2002
Location: Atlantic City, NJ
Distribution: Ubuntu & Arch
Posts: 3,503

Rep: Reputation: 57
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.
 
Old 05-31-2003, 12:41 PM   #10
Aldyn
LQ Newbie
 
Registered: May 2003
Location: Ontario, Canada
Distribution: Redhat 9.0
Posts: 11

Original Poster
Rep: Reputation: 0
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Data lost/changed when moving harddrive to another computer mdb Linux - Hardware 1 05-06-2005 01:59 AM
Can't copy files from an SCO Unix System V computer to a Linux computer gnppapas Linux - General 2 11-27-2004 02:39 PM
Trash, Computer & user's home icon changed to read-only tuxrules Fedora 1 08-12-2004 04:49 PM
Now that I've changed to linux, my next computer will be a ... shadowhunter General 69 01-08-2004 05:11 PM
How can i portage Linux from computer with Celeron proc to computer with Pentium 166? gdi Linux - General 4 05-31-2003 02:11 AM


All times are GMT -5. The time now is 08:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration