SUMMARY: faking hostid on SS10/SS20

Date: Thu Jan 25 1996 - 06:34:26 CST

Hello world !

Thanks a lot for replying. It was my first trial on this mailing list and I am
amazed about the overwhelming echo, about 12 answers in 24 hours.

It is indeed possible to change the hostid:

1) patch hw_serial (the decimal string representation of hostid) in the kernel
   -> Henry Katz <>
2) Shared libraries used
by dynamically linked executables can provide a substitute gethostid()
using the magic of the LD_PRELOAD or LD_LIBRARY_PATH variables. Or a
loadable module can be used. On Sunos 4.1.x, the kernel itself can
be modified, or rebuilt, to return a different hostid. As a last
resort, it is possible to change the bytes in the NVRAM, also, but I
wouldn't recommend it.
Fortunately, most of the work involved in doing this has already been
done, there is a package available in the comp.sources.unix archive,
called hostid-sun. Look for hostid-sun-1.3.1, in volume28. I do not
remember if it works with Solaris, but the same methods should be easy
enough to adapt. Or perhaps there is a newer version. The shared
library method worked well enough on IRIX. :-)
-> Scott McClung
3) Several replies mentioned other ftp-sources offering patching-scripts, even
   the author of such stuff, Mark. C. Henderson (, answered:

I distribute a collection of tools for doing this in various different
ways (loadable kernel drivers, patching live kernel, modifying NVRAM,
shared libs).
4) Giles McGarry ( ) sent me an executable called
   hid_solaris2 and the following lines:

" Once you've uudecoded it:-

1, Ensure you know what you're original hostid was (/usr/ucb/hostid)
2, Run the script hid_solaris2 xxxxxxxxx where xxxxxxxx = the new hostid.
3, You'll see the program creates a script on stdout
4, run the hid_solaris2 command again and send stdout into a file
5, From root run the file


# ./hid_solaris2 72703173
# this script sets the hostid to 72703173
adb -w -k /kernel/unix /dev/mem <<END
hw_serial/W 0x31393139
hw_serial+4/W 0x39353533
hw_serial+8/W 0x31350000
# ./hid_solaris2 72703173 >/tmp/hid
# ./tmp/hid
# /usr/ucb/hostid

This is a temporary hack, for a semi perminant hack, put this sequence in a
startup script. "

I'm not shure whether I should place this script (35K) into this summary, so
if anybody needs it, tell me and I'll mail it directly to You.

Peter Marx

Additional Thanks to these repliers

"Bert N. Shure" <>
 Jay Lessert <>
 Chris Eastman <>
 Markus Storm <>
 Reto Lichtensteiger <> (Marcos Padilla Morales) (Thomas Tonino) (Martin Huber)

This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:10:51 CDT