From: andy@ie.utoronto.ca (Andy Sun)
Subject: Re: root access over NFS
Organization: University of Toronto, Department of Industrial Engineering
Date: Sun, 13 Sep 1992 18:11:07 GMT

peter@astol.astro.lu.se (Peter Linde) writes:


>As super-user I want to have root access rights also on NFS mounted file
>systems, belonging to another HP machine.  In SunOS it is implemented
>by setting appropriate flags in the Sun's exports file. Is there any solution 
>under HP-UX?

>Peter Linde

I tried to do the same thing a few months back and ended up phoning the HP
hotline for help. The answer is YES, you can do so, but you'll have to
modify the kernel using adb. HP's (ancient) NFS doesn't support flags in
/etc/exports. Since I don't particularly like messing with the kernel
this way (modifying it using a binary editor) and HP explicitly said this
modification is unsupported, I've never actually tried the following myself.

------------------------------ Cut Here --------------------------------
From rew@hpuerca.atl.hp.com Fri Jun 12 16:40:07 1992
Received: from hpuerca.atl.hp.com by relay.hp.com with SMTP
	(16.6/15.5+IOS 3.13) id AA12164; Fri, 12 Jun 92 13:38:33 -0700
Message-Id: <9206122038.AA12164@relay.hp.com>
Received: by hpuerca.atl.hp.com
	(15.11/15.6) id AA16561; Fri, 12 Jun 92 16:38:53 edt
From: Rob Wolters <rew@hpuerca.atl.hp.com>
Subject: nfs_root
To: andy@ie.utoronto.ca
Date: Fri, 12 Jun 92 16:38:51 EDT
Mailer: Elm [revision: 64.9]
Status: OR



   
    ===================================================================
     _____/_______
    |    /        |    H E W L E T T     North American Response Center
    |   /__   ___ |
    |  /  /  /  / |    P A C K A R D          Support Note #020
    | /  /  /__/  |                           
    |______/______|                            Root access to NFS
          /
    ===================================================================


How to use adb to patch the disk-resident kernel (/hp-ux) so that the
UID of root (0) transfers across an NFS mount rather than being mapped
to kernel symbol 'nobody', which has a value of -2.

Use this procedure to patch the kernel on an NFS server.  This procedure
has been tested on HP 9000 Series 300 & 400 computers running HP-UX
7.0x and 8.0, Series 700 computers running 8.05, and on Series 800 
computers running 7.0x and 8.0.  It may also work with other
hardware/software combinations.

*** Do not use the "_" when editing a 9000/700 Series.

WARNING: This defeats an important security feature of NFS.  HP shall
         not be liable for any file system modifications made possible
         by the commands below.  IT IS UNSUPPORTED.


COMMANDS                               COMMENTS
----------------------------------     -------------------------------
# adb -w /hp-ux                        Run the absolute debugger with
executable file = /hp-ux                 the write option on the kernel
core file = core
ready

nobody?D                               Display 'nobody' in decimal
_nobody:    -2                         System's repsonse: its value is -2

nobody?W0                              Use a 4-byte write to change the
                                         contents of 'nobody' to 0
_nobody:    0xFFFFFFFE   =   0x0       System's response: its value is now 0

nobody?D                               Display (in decimal) the contents
                                         of 'nobody' to double-check
_nobody:    0                          System's response: its value is still 0

$q                                     Type '$q' to exit adb  


You have only modified the DISK-RESIDENT kernel, /hp-ux.  You must
reboot to load the patched kernel into memory.

[End of note]
------------------------------ Cut Here --------------------------------

Andy
-- 
Andy Sun (andy@ie.utoronto.ca)		4 Taddle Creek Road, Toronto
Computing Coordinator			Ontario, Canada. M5S 1A4
Department of Industrial Engineering	Phone: (416) 978-2920
University of Toronto			Fax:   (416) 978-3453
Newsgroups: comp.sys.hp