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?...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| 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... |
| |||
| 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" |
| ||||
| 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... |