- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- HELP*** HP-UX Script
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
08-02-2001 02:38 AM
08-02-2001 02:38 AM
HELP*** HP-UX Script
Anyone can help me about how to restricted open session (telnet) for each user.
I want to allow 2 session only for each user.
Any tools or script solve my problem.
Many thanks in advance for your help.
Rgds,
ES
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2001 03:13 AM
08-02-2001 03:13 AM
Re: HELP*** HP-UX Script
usr=$(whoami)
case $usr in
# Put special users here
root|informix) echo "Special users go on in"
;;
*) if [ $(who | grep $usr | wc -l) -gt 2 ]
then
echo "You are already logged in. Your sessions are"
who | grep $usr
exit
fi
;;
esac
Give it a whirl
Tim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2001 03:16 AM
08-02-2001 03:16 AM
Re: HELP*** HP-UX Script
No apparently solution , but you can modify the /etc/profile to meed your requirement :
Add the following to you /etc/profile :
-=-=-=-=-=
trap "" 1 2 3
nuser=`who | grep $LOGNAME | wc -l`;
if test "$nuser" -gt 2
then
exit
fi
trap 1 2 3
-=-=-=-=-=-=
It should work.
Hope this solve your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2001 06:10 AM
08-02-2001 06:10 AM
Re: HELP*** HP-UX Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2001 11:27 AM
08-02-2001 11:27 AM
Re: HELP*** HP-UX Script
if [ $(id -u) -gt 100 ]; then
if ! $(grep -q $LOGNAME /etc/bypass); then
if [ $(wc -h $LOGNAME | wc -l) -gt 2 ]; then
cat <<.
I'm sorry. You're already on twice. Goodbye!
.
fi
fi
fi
Naturally, we've only accounted for users of the posix, korn, and bourne-again shells.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2001 11:29 AM
08-02-2001 11:29 AM