- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- stop users from login the system
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2002 12:34 PM
04-08-2002 12:34 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2002 12:40 PM
04-08-2002 12:40 PM
Solutionif [ -a /var/adm/lock.out -a $LOGNAME != "root" ] ; then
echo "System locked up..."
exit
fi
This way if I do a "touch /var/adm/lock.out", I can lock out all users (except for "root" of course)
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2002 12:40 PM
04-08-2002 12:40 PM
Re: stop users from login the system
if [[ `id -u` -ne 0 ]] ; then
echo "No logins except for root allowed at this time"
exit 0
fi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2002 12:40 PM
04-08-2002 12:40 PM
Re: stop users from login the system
Sandip
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2002 12:41 PM
04-08-2002 12:41 PM
Re: stop users from login the system
You can just put 'exit' command in the $HOME/.profile file. If you don't want the user to log in the system, then delete that user ?
Also there are lot of security files which prevents logging to the system. It depends on the services you are using - ftp, telnet, rlogin etc.
HTH,
Shiju
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2002 12:43 PM
04-08-2002 12:43 PM
Re: stop users from login the system
in /etc/profile add the following lines :
loginid=`who am i | awk '{print $1}'`
echo $loginid
if [ $loginid = oracle ]
then
exit
fi
you are good to go.
Manoj Srivastava
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2002 12:58 PM
04-08-2002 12:58 PM
Re: stop users from login the system
1. you can lock the user by putting LK word in password field for all the user's who want to block. You have to put LK antry in password file where encrypted password is stored.
This way you can control the login access and you can allow him to login in case you decide to do so in future.
-pap
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2002 05:14 AM
04-09-2002 05:14 AM
Re: stop users from login the system
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2002 05:39 AM
04-09-2002 05:39 AM
Re: stop users from login the system
If the user is a csh user, modify /etc/csh.login instead of /etc/profile.
If you are trying to lockout all users (other than root), there is another option if using 11.x.
11.0 (with the cumulative login patch) added support for /etc/nologin. This basically does what others have done with modifications to /etc/profile (and /etc/csh.login). See the following 2 threads:
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x5e730b0717d1d5118ff40090279cd0f9,00.html
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x6a1272106351d5118fef0090279cd0f9,00.html
Note that none of these address ftp access. You should comment out ftp in /etc/inetd.conf and restart inetd (inetd -c).
CDE users are not affected by /etc/profile, /etc/csh.login, nor /etc/nologin hacks. You need to stop dtlogin with "/sbin/init.d/dtlogin.rc stop".
Darrell
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2002 03:05 AM
04-11-2002 03:05 AM
Re: stop users from login the system
Not all program use /etc/profile when a user connects; you will need to check other things, eg ftp (put an entry for that user in /etc/ftpd/ftpusers), X (cp /usr/dt/config/Xstartup to /etc/dt/config/Xstartup and edit that using one of the above scriptlets)
The easiest way to do the above, is if your server is trusted, to use the admin lock option on a user, this can be set by using /usr/lbin/modprpw (I can't remember the flags but you can see them in the 11i man page on docs.hp.com)
But this doesn't seem to work with some versions of ssh (if you use that)
dave
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2002 03:47 AM
04-11-2002 03:47 AM
Re: stop users from login the system
touch /etc/nologin
locks everyone out, and
rm /etc/nologin
allows everyone back in.
It should be tested in your /etc/profile script.
Of course, remember to shutdown ftp also.
live free or die
harry