SUMMARY: faking hostid on SS10/SS20

From: peter.marx@va.otn.dasa.de
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 <hkatz@panix.com>
=============================================================================
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 mcclung@ridgecrest.ca.us
=============================================================================
3) Several replies mentioned other ftp-sources offering patching-scripts, even
   the author of such stuff, Mark. C. Henderson (mch@squirrel.com), answered:

I distribute a collection of tools for doing this in various different
ways (loadable kernel drivers, patching live kernel, modifying NVRAM,
shared libs).

ftp://ftp.wimsey.com/pub/crypto/sun-stuff/change-sun-hostid-1.6.2.tar.gz
OR
ftp://ftp.netcom.com/pub/he/henderso/change-sun-hostid-1.6.2.tar.gz

sunsite.unc.edu:/pub/sun-info/admin-tools
canelo.ing.udec.cl:/pub/UNIX/sun/sources
==============================================================================
4) Giles McGarry ( gilesm@cellnet.co.uk ) 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

ie

# ./hid_solaris2 72703173
#!/bin/sh
# 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
END
# ./hid_solaris2 72703173 >/tmp/hid
# ./tmp/hid
# /usr/ucb/hostid
72703173

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
DASA AG LFK GmbH
Munich
Germany

Additional Thanks to these repliers

"Bert N. Shure" <bert@solsource.com>
 Jay Lessert <jayl@lattice.com>
 Chris Eastman <chris@cwi.net>
 Markus Storm <storm@plato.uni-paderborn.de>
 Reto Lichtensteiger <rali@meitca.com>
 marcos@ing.udec.cl (Marcos Padilla Morales)
 ttonino@bio.vu.nl (Thomas Tonino)
 hu@garfield.m.eunet.de (Martin Huber)



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