1753819 Members
9187 Online
108805 Solutions
New Discussion юеВ

Re: disable user login

 
SOLVED
Go to solution
juno2
Super Advisor

disable user login

Cos I would like to do the db maintanence , how can I temparory disable the user login ? thx.
8 REPLIES 8
T G Manikandan
Honored Contributor
Solution

Re: disable user login

If it is hpux user then

lock
#passwd -l

unlock
#passwd


Thanks
juno2
Super Advisor

Re: disable user login

thx TG , but how can i disable all user login ?
Pete Randall
Outstanding Contributor

Re: disable user login

Use the /etc/nologin functionality of /etc/default/security. See this thread:

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x78ae50dde50cd71190050090279cd0f9,00.html


Pete

Pete
T G Manikandan
Honored Contributor

Re: disable user login

create a file

#cd /etc
#touch nologin


Thanks
T G Manikandan
Honored Contributor
Domenico_5
Respected Contributor

Re: disable user login

hi

you can reboot your system and go in single user mode.

steps:

1) reboot and interrupt it when you read on console < press any key..>

2) write bo and answer yes when you read

3) at the prompt write hpux -is

4) wait for the boot

5) when you have the prompt write mount -a for mounting all file system

Ok now you are in single user and you can work only you on console.

regards
T G Manikandan
Honored Contributor

Re: disable user login

Bill Hassell
Honored Contributor

Re: disable user login

As mentioned, the file /etc/nologin can be used to prevent ordinary user logins (root can still login), but ONLY at 11.0 or higher and for poorly patched versions of 11.0, it will not work. You can create the functionality by editing /etc/profile (and /etc/csh.login and any other non-standard shell profiles) to add something like this:

if [ -r /etc/nologin ]
then
if [ "$(/usr/bin/id -u)" = "0" ]
then
/usr/bin/banner "No user"
/usr/bin/banner "logins"
echo
echo "System Maintenance underway"
else
/usr/bin/clear
echo "No logins allowed at this time"
echo
/sbin/cat /etc/nologin
sleep 5
exit
fi
fi


Bill Hassell, sysadmin