How to change host ID under Solarix 2.x?

How to change host ID under Solarix 2.x?

Post by Hseuh-Lin Ku » Fri, 06 May 1994 06:48:46



Hi Solaris Expert,
   I am curious about is there any way to change hostid
under Solaris 2.x except physical changing EPROM on the
system board?
   In SunOS 4.x I know I can easily patch hostid using
adb and I am curious if anyone knows how to change hostid
under Solaris 2.x?
  Thanks in advance!

                          Hseuhlin May 4

 
 
 

How to change host ID under Solarix 2.x?

Post by Jack Morris » Fri, 06 May 1994 23:28:07



Quote:>   I am curious about is there any way to change hostid
>under Solaris 2.x except physical changing EPROM on the
>system board?

I am curious why you'd want to, other than stealing licensed software?
---

Jack Morrison/Jet Propulsion Lab/MS107-102 4800 Oak Grove Dr, Pasadena CA 91109

 
 
 

How to change host ID under Solarix 2.x?

Post by Anne Nol » Sat, 07 May 1994 00:46:45




>>   I am curious about is there any way to change hostid
>>under Solaris 2.x except physical changing EPROM on the
>>system board?

>I am curious why you'd want to, other than stealing licensed software?
>---
>Jack Morrison/Jet Propulsion Lab/MS107-102 4800 Oak Grove Dr, Pasadena CA 91109

Well, I can imagine several legit reasons.  In fact we had to do this when a standalone
machine joined the network, and its name had already been taken by another
machine.

Anne Nolan

 
 
 

How to change host ID under Solarix 2.x?

Post by Karri Kakson » Sat, 07 May 1994 16:48:56



> : >   I am curious about is there any way to change hostid
> : >under Solaris 2.x except physical changing EPROM on the
> : >system board?

> : I am curious why you'd want to, other than stealing licensed software?
> Jack,
> There have been times when a server goes down
> and you might want to move the keyed software to another system that is up
>    and running
> and it's after hours
> and the vendor is closed for the evening/weekend
> and not everyone wants to steal software.
> --joe

The hostid will also change _every_ time you install/reinstall
SolarisX86 2.1. There is no EPROM on a PC. The hostid is taken by some
algorithm out of thin air and it has no connection to the hardware or the
disks from which you install the software.

We do use the hostid for protection but still I feel that there should be
an utility to set the hostid.

--
Karri Kaksonen OH2BEK .......................... Beam me up Scotty,
Unda Oy - A Scitex subsidiary .................. there's no intelligent
tel +358-0-52558522 fax +358-0-52558585 ........ life down here.
Kutojantie 7, FIN-02630 Espoo, Finland .........   [Dr. Spock to Enterprise]

 
 
 

How to change host ID under Solarix 2.x?

Post by Jason C. Aust » Sun, 08 May 1994 04:39:03




-> >

-> >>   I am curious about is there any way to change hostid
-> >>under Solaris 2.x except physical changing EPROM on the
-> >>system board?
-> >
-> > I am curious why you'd want to, other than stealing licensed software?
-> > ---

-> > Jack Morrison/Jet Propulsion Lab/MS107-102 4800 Oak Grove Dr, Pasadena CA 91109
-> >
-> I would like to do this on both 4.1.3 and 2.3 because we have backup
-> hardware for our server if it dies.  We want to be able to reboot the
-> backup hardware so that it will be indistinguishable from the original
-> server in the event of failure.  I do not believe that this is
-> stealing licensed software as it will only be used when the hardware
-> on which the software is licensed is physically dead.

        I can help you with 4.1.3, but I haven't looked at 2.3 yet.

Run:
adb -w -k /vmunix /dev/mem

Now enter this and hit return twice:
_gethostid+4/i

You'll get this:

_gethostid+4:   call    _machineid
_gethostid+8:   nop

The trick is to replace these eight bytes with machine code that will
load the hostid you want into %o0.

At gethostid+4, we want to use SETHI to set the top bits of %o0, and
at gethostid+8, we want to binary or in the low bits.  Here's an
algorithm for coming up with the right values:

#define HIMASK 0x3FFFFF
#define LOWMASK 0x3ff
#define SETHI 0x11000000
#define OR    0x90122000

wordone = SETHI | ((newid>>10)&HIMASK);
wordtwo = OR | (newid&LOWMASK);

I don't remember how I came up with this, and I haven't had enough
coffee to try and figure it out again.

For an example, say we want to set the hostid to 0x12345678.  Using
the above algorithm, wordone would be 0x11048D15 and wordtwo would be
0x90122278.  Install these instructions with adb like this:

_gethostid+4/W0x11048D15
_gethostid+8/W0x90122278

The hostid function will now kick out 12345678.  This change is made
in memory and will go away at the next reboot.

If anyone figures out how to do this same thing under 2.3, please send
it to me, as I doubt I will have a chance to work on it.
--
Jason C. Austin

 
 
 

How to change host ID under Solarix 2.x?

Post by Bob Dowli » Sun, 08 May 1994 05:19:58


Here's a simple way to do it under Solaris 2.3.  
I'm no adb guru so there may well be a better way.

Because adb doesn't show a prompt, I'm indenting adb's responses with a couple of
spaces.

$ lmhostid            
lmhostid - Copyright (C) 1989, 1991 Highland Software, Inc.
The FLEXlm host ID of this machine is "572043da"

$ su
Password:
# adb -kw /kernel/unix /dev/mem
  physmem 1b0e
hw_serial/s
  hw_serial:
  hw_serial:      1461732314            (Decimal version of the hostid)
hw_serial/w '12'
  hw_serial:      0x3134  =       0x3132
hw_serial+2/w '34'
  hw_serial+2:    0x3631  =       0x3334
hw_serial+4/w '56'
  hw_serial+4:    0x3733  =       0x3536
hw_serial+6/w '78'
  hw_serial+6:    0x3233  =       0x3738
hw_serial+8/w '90'
  hw_serial+8:    0x3134  =       0x3930
hw_serial/s
  hw_serial:
  hw_serial:      1234567890
^D
# ^D

$ lmhostid    
lmhostid - Copyright (C) 1989, 1991 Highland Software, Inc.
The FLEXlm host ID of this machine is "499602d2"

The hostid remains changed until the next reboot.

--------
Bob Dowling:                    UNIX Support,
                                University of Cambridge Computing Service,

+44 223 334728                  Cambridge, UK.  CB2 3QG.

 
 
 

How to change host ID under Solarix 2.x?

Post by Casper H.S. D » Sun, 08 May 1994 22:44:16



Quote:>    I can help you with 4.1.3, but I haven't looked at 2.3 yet.
>Run:
>adb -w -k /vmunix /dev/mem
>Now enter this and hit return twice:
>_gethostid+4/i
>You'll get this:
>_gethostid+4:   call    _machineid
>_gethostid+8:   nop
>The trick is to replace these eight bytes with machine code that will
>load the hostid you want into %o0.

Why don't you replace the gethostid() system call in
/usr/kvm/sys/init_sysent.c with one that returns the
hostid you want it to return?  (Or implement a sethostid/gethostid
system call pair)?

Much safer and easier to do than mucking with adb.

Casper

 
 
 

How to change host ID under Solarix 2.x?

Post by Craig Pet » Sat, 07 May 1994 10:10:27


(email to Anne bounced)

Anne, I think you may be confusing hostid with hostname.  Hostid
is an 8-character code, much like a serial number, which is displayed
when you power on the machine or enter /usr/ucb/hostid. Many software
companies use this when generating software license passwords/tokens
for customer machines.

Of course, I could have misunderstood your example.

Thanks




>>>   I am curious about is there any way to change hostid
...
>>I am curious why you'd want to, other than stealing licensed software?
...
>Well, I can imagine several legit reasons.  In fact we had to do this when a standalone
>machine joined the network, and its name had already been taken by another
>machine.

>Anne Nolan

--

SrUnixSunSolarisAdmin/SysGuiRpcDevlpr/Contract/AvlAug94/CA/AZ/NW/NYC/ALASKA/INTL
NBCS: B3/5 t+ f+ w g r+ s- k-v cd  
 
 
 

How to change host ID under Solarix 2.x?

Post by Joe Carval » Sat, 07 May 1994 08:34:57



: >   I am curious about is there any way to change hostid
: >under Solaris 2.x except physical changing EPROM on the
: >system board?

: I am curious why you'd want to, other than stealing licensed software?
: ---

: Jack Morrison/Jet Propulsion Lab/MS107-102 4800 Oak Grove Dr, Pasadena CA 91109

Jack,
There have been times when a server goes down
and you might want to move the keyed software to another system that is up
        and running
and it's after hours
and the vendor is closed for the evening/weekend
and not everyone wants to steal software.
--joe


Yeah, it's my opinion...

 
 
 

How to change host ID under Solarix 2.x?

Post by Morry Ka » Sat, 07 May 1994 02:07:27




>>   I am curious about is there any way to change hostid
>>under Solaris 2.x except physical changing EPROM on the
>>system board?

> I am curious why you'd want to, other than stealing licensed software?
> ---

> Jack Morrison/Jet Propulsion Lab/MS107-102 4800 Oak Grove Dr, Pasadena CA 91109

I would like to do this on both 4.1.3 and 2.3 because we have backup
hardware for our server if it dies.  We want to be able to reboot the
backup hardware so that it will be indistinguishable from the original
server in the event of failure.  I do not believe that this is
stealing licensed software as it will only be used when the hardware
on which the software is licensed is physically dead.
--
------------------------------------------------------
Morry Katz
Rockwell Science Center


(415)723-9427 (office)
(415)694-9121 (beeper)
------------------------------------------------------
 
 
 

How to change host ID under Solarix 2.x?

Post by Jason C. Aust » Tue, 10 May 1994 22:56:41




->
-> >      I can help you with 4.1.3, but I haven't looked at 2.3 yet.
->
-> >Run:
-> >adb -w -k /vmunix /dev/mem
->
-> >Now enter this and hit return twice:
-> >_gethostid+4/i
->
-> >You'll get this:
->
-> >_gethostid+4:   call    _machineid
-> >_gethostid+8:   nop
->
-> >The trick is to replace these eight bytes with machine code that will
-> >load the hostid you want into %o0.
->
-> Why don't you replace the gethostid() system call in
-> /usr/kvm/sys/init_sysent.c with one that returns the
-> hostid you want it to return?  (Or implement a sethostid/gethostid
-> system call pair)?
->
-> Much safer and easier to do than mucking with adb.
->
-> Casper

        If you've done this, please provide some code.
--
Jason C. Austin