Unix Technical Forum

/etc/nologin file -> Is it possible to allow specified users to log in?

This is a discussion on /etc/nologin file -> Is it possible to allow specified users to log in? within the AIX Operating System forums, part of the Unix Operating Systems category; --> I need to disable user access to an Aix 4.2 box for the next few days while I perform ...


Go Back   Unix Technical Forum > Unix Operating Systems > AIX Operating System

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-05-2008, 03:41 AM
Tom Brehony
 
Posts: n/a
Default /etc/nologin file -> Is it possible to allow specified users to log in?


I need to disable user access to an Aix 4.2 box for the next few days while
I perform
system maintenance. Creating a file called /etc/nologin blocks logins from
all but the
root user.

This is good but ideally I would like for one or two other specified users
to be able to
login as well.

Any ideas on how I can do this?

Tom.


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-05-2008, 03:41 AM
Lothar Krauss
 
Posts: n/a
Default Re: /etc/nologin file -> Is it possible to allow specified users to log in?

Tom Brehony wrote:

> Creating a file called /etc/nologin blocks logins from
> all but the
> root user.
>
> This is good but ideally I would like for one or two other specified users
> to be able to
> login as well.


one simple example: Create a file /etc/myusers.allow with the login names
(one per line) you want to allow. Than put the following lines in
/etc/profile directly after the "readonly LOGNAME" command:

-->
if [ "$LOGNAME" != "root" ]
then
if [ -r /etc/myusers.allow ]
then
grep -q '^ *'$LOGNAME' *$' /etc/myusers.allow
if [ "$?" != "0" ]
then
logout
fi
fi
fi
<--

But this will _not_ stop FTP access!

Lothar
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-05-2008, 03:41 AM
Tom Brehony
 
Posts: n/a
Default Re: /etc/nologin file -> Is it possible to allow specified users to log in?

Thanks Lothar!

Tom.

"Lothar Krauss" <news5@lkrauss.de> wrote in message
news:cbv4pr$er1$03$1@news.t-online.com...
> Tom Brehony wrote:
>
> > Creating a file called /etc/nologin blocks logins from
> > all but the
> > root user.
> >
> > This is good but ideally I would like for one or two other specified

users
> > to be able to
> > login as well.

>
> one simple example: Create a file /etc/myusers.allow with the login names
> (one per line) you want to allow. Than put the following lines in
> /etc/profile directly after the "readonly LOGNAME" command:
>
> -->
> if [ "$LOGNAME" != "root" ]
> then
> if [ -r /etc/myusers.allow ]
> then
> grep -q '^ *'$LOGNAME' *$' /etc/myusers.allow
> if [ "$?" != "0" ]
> then
> logout
> fi
> fi
> fi
> <--
>
> But this will _not_ stop FTP access!
>
> Lothar



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 01-05-2008, 03:42 AM
Jeffrey Ross
 
Posts: n/a
Default Re: /etc/nologin file -> Is it possible to allow specified users to log in?

Correct, but this assumes that your users log in with a sh or ksh.
If they are set up (in /etc/passwd) for csh they will by-pass /etc/profile.
In that case you would have to modify /etc/csh.login as well.
Regards,
Jeffrey.


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 01-05-2008, 03:45 AM
Tom Brehony
 
Posts: n/a
Default Re: /etc/nologin file -> Is it possible to allow specified users to log in?

Yes, all users are set up to use ksh, so this has worked for me.

Tom.

"Jeffrey Ross" <jeffrey.rossATairways.co.nz@no.spam> wrote in message
news:40e4b287$1@news.iconz.co.nz...
> Correct, but this assumes that your users log in with a sh or ksh.
> If they are set up (in /etc/passwd) for csh they will by-pass

/etc/profile.
> In that case you would have to modify /etc/csh.login as well.
> Regards,
> Jeffrey.
>
>



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 07:16 AM.


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