login error when a NFS-mounted home is exported without root access

login error when a NFS-mounted home is exported without root access

Post by Jose M. Alcaid » Tue, 25 Nov 1997 04:00:00

This problem first appeared in 2.2.2 and continues in 2.2.5. I'm
posting this message to the newsgroup before submitting a bug

Basically, login(1) calls chdir(home) before calling setuid(user).
When a home directory is NFS-mounted, and it is being exported
without root access permissions, any operation with that filesystem
made by root (such as chdir(), or the .hushlogin check) is seen by
the server as made by "nobody". The result is that chdir() fails,
and login says "No home directory - logging with home=/".

  - chmod o+x <home directory> (ugly)
  - if you administer the server, re-export the home directory
    granting root access to the FreeBSD box[es] (may be even uglier)
  - edit /usr/src/usr.bin/login/login.c and move the chdir()
    after the setuid(), or viceversa, and remake /usr/bin/login


Universidad del Pais Vasco              | http://www.we.lc.ehu.es/~jose
Dpto. de Electricidad y Electronica     |
Facultad de Ciencias - Campus de Lejona | Tel.:  +34-4-4647700 x2624
48940 Lejona (Vizcaya) - SPAIN          | Fax:   +34-4-4858139
               "Go ahead... make my day." - H. Callahan


1. NFS export without root access ?

I just tried to do an NFS export without root access from our linux machine
``r_nest'', but wasn't successfully.

We use the following linux release:
kernel          1.1.45
rpc.nfsd        Universal NFS Server, version 2.0
rpc.mountd      Universal NFS Server, version 2.0

I've put the following line in r_nest:/etc/exports:

        /user *.lpr.e-technik.tu-muenchen.de(secure,root_squash,rw,

Then I killed & restarted rpc.mountd and rpc.nfsd so they read the modified file.

When I mount r_nest:/user on another machine, this machine's root has full root
access to the mounted partition.

Did anyone identify (and solve) the same problem?
Is there any workaround?
Does someone know where I can find the sources for rpc.nfsd? I couldn't find it
at ftp.cdrom.com in slackware_source.

Thanks for your help


2. Cyrix 6x86 Support?

3. exports --> share in SRV4: root access of NFS FS

4. Yet another newbie needs help (SuSE Linux 5.3)

5. NFS access to filesystems mounted under an exported directory

6. smtp security

7. Mounting windows partition without root access

8. Need help on screen saver

9. nfs clients don't see other mounts under nfs export

10. export nfs-mounted dir with samba?

11. unable to access home directory (NIS User, NFS Mount)

12. *slow* KDE login when $HOME is nfs mounted

13. Mounting a cd-rom without root access - How is this done?