Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[Help] About the Linux hostid

Status
Not open for further replies.

jizhongren

Junior Member level 3
Joined
Feb 18, 2004
Messages
27
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,281
Activity points
227
I have install the red hat 7.2 in pc.
I want to change the hostid.Can you help me!!!
Thanks!!
 

superyanlm

Newbie level 6
Joined
Jan 3, 2003
Messages
12
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
76
The hostid in Linux is the eternet address.
You can use ifconfig change it. But if you restart,
you must setup it again. Or you can add the command in the rc2.d. Enjoy it!
 

wzdreamer

Full Member level 2
Joined
Jan 16, 2002
Messages
124
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
1,165
nope.... the hostid is not equal to ethernet address!

you can get hostid of your Linux box with this command:
/usr/bin/hostid

The hostid returned from the command looks like that:

a8c05b8d

you can get hostid when you're root or standart user, but only root can change it!!!

you can get your ethernet MAC address with ifconfig...

/sbin/ifconfig eth0

The HW address returned from the command looks like that:

00:07:E9:5F:C2:20

You can see how to calculate hostid, where it is stored, when you change it in the source of hostid. There you can see how it is calculated in the case if you have not NIC in your Linux box...
 

gerade

Advanced Member level 4
Joined
May 4, 2004
Messages
109
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,298
Location
the hole eletron left behind
Activity points
1,014
jizhongren said:
I have install the red hat 7.2 in pc.
I want to change the hostid.Can you help me!!!
Thanks!!

please use uname, read man of it
this command can display hostid

rgs
 

niko_zhang

Advanced Member level 4
Joined
Jun 23, 2001
Messages
108
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
579
test this command: uname -a
 

wzdreamer

Full Member level 2
Joined
Jan 16, 2002
Messages
124
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
1,165
uname -a gives me this:


Linux zerotonine 2.4.26 #8 Wed Apr 14 16:35:31 PDT 2004 i686 unknown unknown GNU/Linux
 

wzdreamer

Full Member level 2
Joined
Jan 16, 2002
Messages
124
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
1,165
# uname --help

Usage: uname [OPTION]...
Print certain system information. With no OPTION, same as -s.

-a, --all print all information, in the following order:
-s, --kernel-name print the kernel name
-n, --nodename print the network node hostname
-r, --kernel-release print the kernel release
-v, --kernel-version print the kernel version
-m, --machine print the machine hardware name
-p, --processor print the processor type
-i, --hardware-platform print the hardware platform
-o, --operating-system print the operating system
--help display this help and exit
--version output version information and exit

Report bugs to <bug-coreutils@gnu.org>.

see that uname doesn't have anything about hostid!!!
 

RoZ

Junior Member level 1
Joined
May 31, 2004
Messages
18
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
183
Its all in the Web ...

(https://howtos.linux.com/guides/abs-guide/system.shtml)

says:

'hostid'

This command allegedly fetches a "unique" serial number for a particular system. Certain product registration procedures use this number to brand a particular user license. Unfortunately, hostid only returns the machine network address in hexadecimal, with pairs of bytes transposed.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top