[comp.unix.aux] Login without home directory

ronniek@cs.tamu.edu (Ronnie Killough) (06/13/90)

I have a Mac IIci, A/UX 1.1.1.  I want to allow someone to login
even if they don't have a home directory (i.e. the account is a
YP account, but their home directory is not mounted).

By default, this is not allowed...if you try to login w/o a home
directory, it logs you out immediately.  How do I override this
'feature'?

Sorry if this is an old question.

Thanks!

liam@cs.qmw.ac.uk (William Roberts) (06/13/90)

In <5801@helios.TAMU.EDU> ronniek@cs.tamu.edu (Ronnie Killough) writes:

>I have a Mac IIci, A/UX 1.1.1.  I want to allow someone to login
>even if they don't have a home directory (i.e. the account is a
>YP account, but their home directory is not mounted).

They do need to have somewhere as a working directory in which
to run their shell. I suggest that you use YP to give everyone
a default working directory, e.g. the password entry

        +:::99:99::/tmp:

which picks up everything from YP except their home directory,
which is replaced by /tmp (the 99s are because I just hate
seeing +::0:0::: in passwd files - I don't know of a security
hole that exploits this, but I'd rather not leave uid 0
associated with no password under any circumstances).

Another alternative is to have a guest home directory with a
.login or .profile (as appropriate) that warns people that they
have guest facilities and are not in their home directories.

PS. Why not mount their home directory anyway?
-- 

William Roberts                 ARPA: liam@cs.qmw.ac.uk
Queen Mary & Westfield College  UUCP: liam@qmw-cs.UUCP
Mile End Road                   AppleLink: UK0087
LONDON, E1 4NS, UK              Tel:  071-975 5250 (Fax: 081-980 6533)

ronniek@cs.tamu.edu (Ronnie Killough) (06/15/90)

In article <2377@sequent.cs.qmw.ac.uk> liam@cs.qmw.ac.uk (William Roberts) writes:
>In <5801@helios.TAMU.EDU> ronniek@cs.tamu.edu (Ronnie Killough) writes:
>
>>I have a Mac IIci, A/UX 1.1.1.  I want to allow someone to login
>>even if they don't have a home directory (i.e. the account is a
>>YP account, but their home directory is not mounted).
>
>They do need to have somewhere as a working directory in which
>to run their shell. I suggest that you use YP to give everyone
>a default working directory, e.g. the password entry
>
>        +:::99:99::/tmp:
>
>which picks up everything from YP except their home directory,

This won't work, because I want those who do have their home dir
mounted to be able to use it as the home dir.

>Another alternative is to have a guest home directory with a
>.login or .profile (as appropriate) that warns people that they
>have guest facilities and are not in their home directories.

But what do I add to the system so that it will use this guest home
directory if their real home directory cannot be found?

>PS. Why not mount their home directory anyway?

Well, all of the accounts in the CS department here are YP account,
so you get 1 account and login to any (UNIX) machine...suns, mac A/UX,
NeXT, SGI, IBM RT, Sequent, you name it.  All of these machines are
file-served from a Sun sparc-server, so (almost) all of the YP account
home directories are on the sparc-server.  So, the partitions containing
the user's home directories is mounted on all the Unix boxes.

The problem is: some of the faculty have their home directories on their
local machine.  Their home directory IS exported, and since the Suns run
the automounter, these are automatically mounted on the Suns if they log
into something other than their office machine.  But the Mac isn't running
the automounter (I don't have time to try to compile the PD one), and I
don't want to have to maintain the stupid fstab file to mount 15 or 20
different filesystems and leave them mounted for 15 or 20 different faculty
members.  So, what is the big deal with letting someone login if they don't
have a home directory?  The Suns just say "hey, no home dir...logging in
with home = /".  HOW DO I DO THIS ON THE MACS?

Thanks :-).

michael@xanadu.com (Michael McClary) (07/09/90)

In article <5887@helios.TAMU.EDU> ronniek@cs.tamu.edu (Ronnie Killough) writes:


>[]  So, what is the big deal with letting someone login if they don't
>have a home directory?  The Suns just say "hey, no home dir...logging in
>with home = /".  HOW DO I DO THIS ON THE MACS?

You hack /bin/login.  That's what Sun did, after all.  B-)

If you don't have sources (and I suspect you don't), don't want to or
aren't able to obtain them (which I suspect you don't/can't) and don't
have the time to decompile it (which I also suspect you don't, if you
don't have time to play with automount) you might manage with something
more elaborate and indirect.  (I'm not running A/UX at the moment, so
I'll just sketch.)

Try an experiment.  Write a shell script something like this:

	echo foo
	exec /bin/sh	## Your favorite shell here.

Install it as /bin/foosh, run it to make sure the permissions are right,
then see if:

        +:::99:99::/:/bin/foosh

Makes it run when people log in over the net.  If it does, you can write
a script or program to:

 - Dig their home directory out of the YP database.
 - Switch to it if it's mounted.  (Or try to mount it if you feel adventurous.
   Make sure you've demoted them if you ran as root to do that.)
 - Dig out their favorite shell ditto.
 - Exec it (as -whatever, so it will run .login/.profile).

If it works, you might want to post it for the rest of us.

(Hmmm.  I lifted the /etc/passwd line from the previous post, but I bet
 it should be "+::99:99::/:/bin/foosh")