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