1834051 Members
2442 Online
110063 Solutions
New Discussion

disable login

 
SOLVED
Go to solution
O'lnes
Regular Advisor

disable login

If i need to run the maint. job on the system, how to temparory disable users login to the system?
Andy
14 REPLIES 14
Jean-Luc Oudart
Honored Contributor
Solution

Re: disable login

One way is to put your own IP address in the inetd.sec . Therefore only your workstation will be granted acees to the server (and the console too).

man inetd.sec

Jean-Luc
fiat lux
T G Manikandan
Honored Contributor

Re: disable login

#passwd -l
Robert-Jan Goossens
Honored Contributor

Re: disable login

You can also make a passwd file for maint.purpose

passwd.maint
passwd.org
passwd

Regards

RJ.
David Lodge
Trusted Contributor

Re: disable login

All depends on how you've set up your system, but one quick way which may doesn't need mangling of /etc/passwd is just to disable inetd!

You can also stop people logging in (except for root) by using:
# touch /etc/nologin

But this only blocks users who come in via a process that uses /usr/bin/login (eg telnet/rlogin)
U.SivaKumar_2
Honored Contributor

Re: disable login

Hi,
Give a broadcast message about your decision,
#wall

Then.
#init s
Gone to single user mode
DO your works.
When done,
#init 5
Go to multi-user mode.

regards,
U.SivaKumar
Innovations are made when conventions are broken
O'lnes
Regular Advisor

Re: disable login

how should i do if i don't have the file inetd.sec?
Andy
Robert-Jan Goossens
Honored Contributor

Re: disable login

David,

You are quit right forgot the /etc/nologin, the easy way.

Robert-Jan.
David Lodge
Trusted Contributor

Re: disable login

If you don't have an /etc/inetd.sec - just make one... the file format is in the manual page; essentially:



eg:

telnet allow adminsrv foo
telnet deny *

should do it...
Jean-Luc Oudart
Honored Contributor

Re: disable login

Elif Gius
Valued Contributor

Re: disable login

Hi,

We use ssh...then it is quit easy to disable user login... just change the sshd_config from
+++
AllowUsers root operator userA
+++
to
+++
AllowUsers root
+++
and then restart the ssd daemon...maybe it is useful for the future

Bye
Elif
Paula J Frazer-Campbell
Honored Contributor

Re: disable login

Hi

If you are working at the console you can pull the network cable.

Paula
If you can spell SysAdmin then you is one - anon
Bill Hassell
Honored Contributor

Re: disable login

/etc/nologin does not function prior to 11.0 (ie, 10.20) and does not work if you are not up to date on security patches.

NOTE: /etc/nologin prevents new users from logging in but does nothing to current users and nothing to applications that are running. You would be better off changing to single user mode with a shutdown and interactive reboot into single user mode. That guarentees no users can login and no applications will run.


Bill Hassell, sysadmin
doug hosking
Esteemed Contributor

Re: disable login

Also note that if you want to use /etc/nologin,
you must be sure /etc/default/security has a line 'NOLOGIN=1' in it. Otherwise, HP-UX will not honor the presence of /etc/nologin.
(The /etc/default/security entry can be set once and left enabled all the time, with /etc/nologin created/deleted as needed.)
Ranjith_5
Honored Contributor

Re: disable login

Hi Brian,

Easiest and Safest way is :

#>/etc/nologin OR
#touch /etc/nologin

After this kill all the users currently logged in to the system.They wont be able to login further.

Regards,
Syam