- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: disconnect a user
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
11-14-2002 11:11 AM
11-14-2002 11:11 AM
disconnect a user
I need some help with a shell script I'm writing. How do you disconnect a user? This script is to keep users from getting to the command line. If they sign on, the script should tell them to use the other interface then disconnect them.
Thanks in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2002 11:11 AM
11-14-2002 11:11 AM
Re: disconnect a user
The other simple answer is
in their .profile
trap '' 0 1 2 3 15
echo "Do not use the shell"
sleep 5
exit 0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2002 11:17 AM
11-14-2002 11:17 AM
Re: disconnect a user
ps -ef | grep ' '$USERNAME' ' | grep -v "resetuser" | awk '{ print $1,$2 }'
> /tmp/reset.tmp
PROCESSES=`grep $USERNAME /tmp/reset.tmp | awk '{ print $2 }' | sort -n`
for PROC in $PROCESSES
do
echo "\tKilling process $PROC"
kill $PROC
done
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2002 11:19 AM
11-14-2002 11:19 AM
Re: disconnect a user
USERNAME=$1
should be at the beginning.
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2002 11:19 AM
11-14-2002 11:19 AM
Re: disconnect a user
Call the script/menu you need from users .profile with last line as "exit 0"
or make that script/program as a start-up shell for the user.
Thanks.
Prashant.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2002 11:20 AM
11-14-2002 11:20 AM
Re: disconnect a user
I think the better approach is to make their startup script the "other interface" rather than a shell.
You can do this by substituting the script or executable for a shell in '/etc/passwd'.
You can also do this by 'exec'ing the interface as the last statement in the user's profile:
exec $HOME/interface
The first method is more rigorous in most cases.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2002 11:34 AM
11-14-2002 11:34 AM