- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: How to limit a user to login from a specific I...
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
03-31-2003 02:02 PM
03-31-2003 02:02 PM
How to limit a user to login from a specific IP address only?
Here it goes:
I want to limit a specific user on HP-UX 11.00i so he can only log in from a specific IP address via telnet.
Is this possible using HP-UX tools short of writing a custom shell script (I don't want to re-invento a wheel here)?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2003 02:21 PM
03-31-2003 02:21 PM
Re: How to limit a user to login from a specific IP address only?
Here in this file you can configure to which ip-address you want to give access
Here is the example:
telnet allow
shell allow
exec allow
-USA..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2003 02:49 PM
03-31-2003 02:49 PM
Re: How to limit a user to login from a specific IP address only?
I know of no easy way to do what you require. The only thing I can think of is to modify each users /etc/profile, check the IP addy they are coming from and if it is not the correct one, do an 'exit 1'.
You could also write a script that is called from ~/.profile so that you can have a single point of control for all users and IPs, but if you have an experienced user, s/he could modify their own .profile to take that out.
Good luck in find an appropriate solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2003 04:01 PM
03-31-2003 04:01 PM
Re: How to limit a user to login from a specific IP address only?
About the only & the easisest way to do this would be to obtain & implement tcp_wrappers. Can be had here free:
http://hpux.cs.utah.edu/hppd/hpux/Networking/Admin/tcp_wrappers-7.6/
Although one note - you'll need to compile it with that option enabled. I don't think the option is enabled by default. There are several other points to be aware of so visit the README page:
http://hpux.cs.utah.edu/hppd/hpux/Networking/Admin/tcp_wrappers-7.6/readme.html
especially the section 4.4 on Client username lookups.
HTH,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2003 04:35 PM
03-31-2003 04:35 PM
Re: How to limit a user to login from a specific IP address only?
although not out of the box, but you can do it in your /etc/profile file.
1. in this file grap the users login id that you want to watch.
NAME=$(`whoami`)
2. you want to get the users IP address from where they login.
this is tricky but check this out.
MACHINE=$(`who -Rm`)
now you have a line with the host computers DNS name.
then do a nslookup on the name.
check_user()
{
set -- $(who -Rm)
Machine=${6#\(}
Machine=${Machine%\)}
nslookup $Machine | strings | tail -n 1 | cut -f2 -d":" | read IP
NAME=$(whoami)
if [ $NAME = "usertowatch" -a $MACHINE != "dumbpc" ]
then
exit
else
continue
fi
}
check_user
add the last lines to /etc/profile and give me 10 points .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2003 04:39 PM
03-31-2003 04:39 PM
Re: How to limit a user to login from a specific IP address only?
if [ $NAME = "usertowatch" ] && [ $IP != "10.0.0.1" ]
then
# kick him out
exit 0
fi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2003 04:44 PM
03-31-2003 04:44 PM
Re: How to limit a user to login from a specific IP address only?
this goes into either their .profile or /etc/profile.
if you stick it in theri .profiles, savy users will delete it, BUT if you stick it in the /etc/profile then you have control over it.
greet()
{
set -- $(who -Rm)
Machine=${6#\(}
Machine=${Machine%\)}
nslookup $Machine | strings | tail -n 1 | cut -f2 -d":" | read IP
NAME=$(whoami)
grep ${NAME} /etc/passwd|awk -F: '{print $5}'|awk '{print $1}'|read Name
HOUR=$(date +%H)
if [ $HOUR -le 12 ] && [ $HOUR -ge 0 ]
then
greet=Morning
elif [ $HOUR -gt 12 ] && [ $HOUR -le 18 ]
then
greet=Afternoon
else
greet=Evening
fi
if [ -f /usr/bin/mail ]
then
if mail -e
then
ifmail=$(echo "You've got mail, please check it.")
else
ifmail=$(echo "You don't have mail at this time.")
fi
fi
printf "\n\tGood $greet, $Name, $ifmail\n\n\n"
printf "\tYour PC's IP address is: $IP\n\n"
printf "\tYour PC's name is: $Machine\n\n"
printf "\tToday is: `date +%A`\n\n"
printf "\tDate is: `date +%D`\n\n"
}
greet
you could even kick that "usertowatch" out with a nice message, telling them to go away or to go back to their desk, with a ball and chain, and stay there untill further notice.
:-))
Donny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2003 05:30 PM
03-31-2003 05:30 PM
Re: How to limit a user to login from a specific IP address only?
you can download and install TCP_WRAPPER program into your host from www.software.hp.com
that's easy to way specify IP bloking for your security.
have a good day~