Operating System - HP-UX
1832857 Members
3277 Online
110047 Solutions
New Discussion

Block all users access to the system

 
uadm26
Super Advisor

Block all users access to the system

Hi,

I need to block all users access to change users id's to them. Any sugestions?
11 REPLIES 11
Pete Randall
Outstanding Contributor

Re: Block all users access to the system

How about single user mode?


Pete

Pete
uadm26
Super Advisor

Re: Block all users access to the system

Hi,

Single user is'nt a good option cus some aplications will still up, like ftp applications and DB Oracle too.
harry d brown jr
Honored Contributor

Re: Block all users access to the system

touch /etc/nologin

and see http://forums1.itrc.hp.com/service/forums/questionanswer.do?admit=716493758+1117794907486+28353475&threadId=147806


live free or die
harry d brown jr
Live Free or Die
Muthukumar_5
Honored Contributor

Re: Block all users access to the system

Presently, you can write a shell wrapper as,

#!/bin/ksh

if [[ $LOGNAME != "root" ]]
then
echo "Permission denied to change UID"
echo "contact root"
sleep 1
exit 1
fi

========

Move /usr/sbin/usermod to /usr/sbin/usermodold and put this wrapper as /usr/sbin/usermod

It will work. And you may create users without -o option also.


hth.
Easy to suggest when don't know about the problem!
Muthukumar_5
Honored Contributor

Re: Block all users access to the system

I think you are asking the solution to block users available in the system to change their USERID again. Rgt.
Easy to suggest when don't know about the problem!
Pete Randall
Outstanding Contributor

Re: Block all users access to the system

How will some applications still be up in single user mode? Perhaps you're thinking of just running shutdown - I meant rebooting into single user mode. No apps will be started, no users will be able to connect - it sounds like exactly what you wanted???????


Pete

Pete
uadm26
Super Advisor

Re: Block all users access to the system

Hi,

Thanks for all of you, I've done a script whith all users taht can't login in the system, i can't work in single user cus of users scripts running in cron.
Dave Hutton
Honored Contributor

Re: Block all users access to the system

No offense. But single user mode there are no filesystems that a user script would be trying to use mounted.

I thought cron ran at a higher run level also.

Anyway, glad to hear you found a way.


Devesh Pant_1
Esteemed Contributor

Re: Block all users access to the system

I use
# touch /etc/nologin and that way no one logs in and also
# echo console > /etc/securetty
Devesh Pant_1
Esteemed Contributor

Re: Block all users access to the system

You can also use the /etc/profile to block logins
add this to /etc/profile

TTY=`tty`
if [ $LOGNAME = "root" -a $TTY != "/dev/console" ]
then
echo "No logins allowed at this time, please try back later"
exit 1
fi
Nguyen Anh Tien
Honored Contributor

Re: Block all users access to the system

disable or folowing service.
#telnet
#rlogin
#ssh (if installed)
HP is simple