- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- User xyz should login from from 10.xxx.xx.x server...
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
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
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
03-18-2010 03:37 AM
03-18-2010 03:37 AM
I have a requirement that user “xyz” should able to login from only specific IPaddress (10.xxx.xxx.1/2/3)
Is this need to be added any entry in /etc/hosts.allow? How to archive this only for one user.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2010 05:13 AM
03-18-2010 05:13 AM
Re: User xyz should login from from 10.xxx.xx.x server only
http://forums13.itrc.hp.com/service/forums/questionanswer.do?admit=109447627+1268917971427+28353475&threadId=1341445
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2010 05:26 AM
03-18-2010 05:26 AM
Solution# cd /home/xyz
# cp -p .profile .profile.org -> backup .profile
#vi .profile
add lines as per attached file (change IP address as per requirement)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2010 05:32 AM
03-18-2010 05:32 AM
Re: User xyz should login from from 10.xxx.xx.x server only
You could disable telnet logins and use only SSH. For the user xyz you should use /usr/bin/sh shell (default in HP-UX)
Then you could modify /etc/profile (add your script at the end of this file!) in order to check for the $LOGNAME and $SSH_CLIENT value.
#---------------------------
USER=restricted_user_name
IP=allowed_IP_address_for_USER
CONNIP=`echo $SSH_CLIENT | awk '{print $1'}`
if [ "$LOGNAME" = "$USER" ] ; then
if [ "$IP" != "$CONNIP" ] ; then
echo "You do not have access from $IP."
logout
fi
fi
#---------------------------------------
If you want to let access from multiple IPs you could change thje second if (if [ "$IP" != "$CONNIP" ] ; then ...) like this:
if [ "$IP" != "$CONNIP" -o "$IP" != "$CONNIP2" -o "$IP" != "$CONNIP3" ] ; then ...
Of course, in this case you should declare the variables CONNIP2 and CONNIP3.
Best regards,
Horia.
Horia.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2010 05:35 AM
03-18-2010 05:35 AM
Re: User xyz should login from from 10.xxx.xx.x server only
#cd ~user
#vi .profile
When logged in, the user can override your settings (.profile can be altered by this user).
Horia.
Horia.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2010 08:27 AM
03-18-2010 08:27 AM
Re: User xyz should login from from 10.xxx.xx.x server only
Following is seem to be working fine.
#############################################
FP=`who -Rm | grep prakash | awk '{print $6}'`
if [ $FP = "(xx.xx.xx.xx)" ]
then
echo "OK `hostname`"
else
echo "Not Ok for $FP"
exit
fi
#############################################
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2010 03:33 AM
03-30-2010 03:33 AM