Unix Technical Forum

Reject login if invalid home directory

This is a discussion on Reject login if invalid home directory within the comp.unix.solaris forums, part of the Solaris Operating System category; --> Hi, How, if you can, do you reject a login request if the home directory entry /etc/passwd is invalid?...


Go Back   Unix Technical Forum > Unix Operating Systems > Solaris Operating System > comp.unix.solaris

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-09-2008, 07:05 AM
Pigpenn
 
Posts: n/a
Default Reject login if invalid home directory

Hi,

How, if you can, do you reject a login request if the home directory
entry /etc/passwd is invalid?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-09-2008, 07:06 AM
Michael Vilain
 
Posts: n/a
Default Re: Reject login if invalid home directory

In article <435ab01b$0$23286$db0fefd9@news.zen.co.uk>,
Pigpenn <zen25686@zen.co.uk> wrote:

> Hi,
>
> How, if you can, do you reject a login request if the home directory
> entry /etc/passwd is invalid?


Well, login will assign / as the home directory if the one in
/etc/passwd isn't found. I suppose you could put a .login file (or
whatever the shell account uses), but you'll notice that root's default
directory is intentionally set to /. Unless the user's shell is sh,
there shouldn't be a problem with collision, but I'd put code in
..profile to check if the account login in is not root, then logout.

--
DeeDee, don't press that button! DeeDee! NO! Dee...



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-09-2008, 07:06 AM
Richard L. Hamilton
 
Posts: n/a
Default Re: Reject login if invalid home directory

In article <vilain-1F8D59.08214123102005@comcast.dca.giganews.com>,
Michael Vilain <vilain@spamcop.net> writes:
> In article <435ab01b$0$23286$db0fefd9@news.zen.co.uk>,
> Pigpenn <zen25686@zen.co.uk> wrote:
>
>> Hi,
>>
>> How, if you can, do you reject a login request if the home directory
>> entry /etc/passwd is invalid?

>
> Well, login will assign / as the home directory if the one in
> /etc/passwd isn't found. I suppose you could put a .login file (or
> whatever the shell account uses), but you'll notice that root's default
> directory is intentionally set to /. Unless the user's shell is sh,
> there shouldn't be a problem with collision, but I'd put code in
> .profile to check if the account login in is not root, then logout.
>


Just think twice about doing anything like that together with having
CONSOLE= set in /etc/default/login if it could get you into a situation
where it wouldn't let you log in as a normal user (if an NFS server was
down, say) and it wouldn't let you log in as root either.

--
mailto:rlhamil@smart.net http://www.smart.net/~rlhamil

Lasik/PRK theme music:
"In the Hall of the Mountain King", from "Peer Gynt"
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 01-09-2008, 07:07 AM
Michael Vilain
 
Posts: n/a
Default Re: Reject login if invalid home directory

In article <11lopqfrk9m2695@corp.supernews.com>,
Richard.L.Hamilton@mindwarp.smart.net (Richard L. Hamilton) wrote:

> In article <vilain-1F8D59.08214123102005@comcast.dca.giganews.com>,
> Michael Vilain <vilain@spamcop.net> writes:
> > In article <435ab01b$0$23286$db0fefd9@news.zen.co.uk>,
> > Pigpenn <zen25686@zen.co.uk> wrote:
> >
> >> Hi,
> >>
> >> How, if you can, do you reject a login request if the home directory
> >> entry /etc/passwd is invalid?

> >
> > Well, login will assign / as the home directory if the one in
> > /etc/passwd isn't found. I suppose you could put a .login file (or
> > whatever the shell account uses), but you'll notice that root's default
> > directory is intentionally set to /. Unless the user's shell is sh,
> > there shouldn't be a problem with collision, but I'd put code in
> > .profile to check if the account login in is not root, then logout.
> >

>
> Just think twice about doing anything like that together with having
> CONSOLE= set in /etc/default/login if it could get you into a situation
> where it wouldn't let you log in as a normal user (if an NFS server was
> down, say) and it wouldn't let you log in as root either.


Yes, but I would guess that anyone asking for a .45 isn't going to point
it at their big toe and pull the trigger without first checking that
it's not loaded and there's no shell in the chamber. I'm all for
allowing newbies to hang or shoot themselves if they try and do
something stupid (like what the OP requested).

[yes, the evil queen is in residence this evening]

--
DeeDee, don't press that button! DeeDee! NO! Dee...



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 11:24 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com