[TriLUG] Login not grabbing NIS/passwd diff

Jon Carnes jonc at nc.rr.com
Fri Jan 24 13:07:08 EST 2003


On Fri, 2003-01-24 at 08:56, Mike Shaw wrote:

> >The only way I've found to over-ride that in Linux is
> >use use some scripting in a .login file.  In mine I
> >always look for the existence of bash and then switch
> >my shell to bash if it exists on the local machine.
> >
> This is the first time I've had to do this since
> Debian 2.2 or RH7.2 but what I described should work. 
> My only thought is that the NIS master is running
> Solaris 5.5 and the version of NIS it has could be
> causing me problems.
> 
> >If you need help with something like that, let me
> >know.
> >
> Yes!  I would very much like to see your work-around.
> 
> Thanks,
> 
> Mike
> 
> =====

This is from memory, but it's fairly simple so I can't be far off...  In
the .login file in your home user directory put:

  if [ -x /bin/bash ]; then 
     /bin/bash --login 
     exit
  fi

This checks for the existence of an executable shell "/bin/bash" and
then launches the shell (in login mode) if it exists.  The "--login"
tells the shell to load any environment variables and to check/use the
.bashrc, .bash_profile and .bash_login files.

I used this in an NIS/NFS environment that spanned multiple Unixes
(Solaris, HP-UX, AIX, and Linux).  It always worked fine.

Good Luck - Jon Carnes




More information about the TriLUG mailing list