- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Block users from a particular IP
Categories
Company
Local Language
Forums
Discussions
- Integrity Servers
- Server Clustering
- HPE NonStop Compute
- HPE Apollo Systems
- High Performance Computing
Knowledge Base
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Knowledge Base
Forums
Discussions
- Cloud Mentoring and Education
- Software - General
- HPE OneView
- HPE Ezmeral Software platform
- HPE OpsRamp Software
Knowledge Base
Discussions
Forums
Discussions
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
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
07-02-2008 03:48 AM
07-02-2008 03:48 AM
I have a strange requirement, I would like to block some users coming to Unix server directly from their laptop. The server and their laptop are in same DNS. I have IP filter to block IPs, I can't block all laptop Ips as there are many. Is there any way I can mention that users should only come from a prticular IP and block all the rest? I know we can use staticroute for this, it's again we need to maintain the routes list.
TIA
Shahul
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2008 04:36 AM
07-02-2008 04:36 AM
Re: Block users from a particular IP
You might be able to do it with tcpwrappers if its coming in with a particular protocol.
You certainly will be able to block the traffic with the ipfilter firewall.
TCP Wrappers is available only from http://software.hp.com
ipfilter is available from the above website and your Core OS or Application CD/DVD.
Well TCP may be there do, I'm not going to check, but these are the tools.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2008 08:01 AM
07-02-2008 08:01 AM
Re: Block users from a particular IP
And you have a know host which should be allowed for certain users.
I would suggest a login script which checks the 'who -um' output for those users and make sure an allowed hostname is reported.
Example output:
$ who -um
hein pts/tc Jul 2 11:39 . 29267 pool-71-168-yy-xx.cncdnh.east.verizon.net
hth,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2008 08:22 AM
07-02-2008 08:22 AM
Re: Block users from a particular IP
If "users" then you can only block using some type of scripted shell function. e.g. if $LOGNAME = "BOB" then echo Sorry Bob, goodbye....
If "IP" then any one of the tcpwrapper, inetd.conf or IPSec solutions would work ( pick one ).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2008 09:06 AM
07-02-2008 09:06 AM
Re: Block users from a particular IP
I remember using /var/adm/inetd.sec for making restrictions on specific protocols; If you have not already tried, take a look at the man pages for "inetd.sec".
regards,
John K.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2008 10:09 AM
07-02-2008 10:09 AM
SolutionAt the top of the primary profile (ksh, POSIX sh, bash use /etc/profile), you lockout all interrupts that can bypass the profile tests. Then determine the IP address and username for this particular login and compare the result to a valid user+IP list. If not found on the list, exit.
To get the user's name and hostname/IPaddr, use:
who -muR | awk '{print $1,$NF}' | read USER HOSTIP
IPADDR=$(getip $HOSTIP)
echo "user=$USER, IP=$IPADDR"
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2008 06:50 AM
07-10-2008 06:50 AM
Re: Block users from a particular IP
I am going to script it, I think that is the best way. I will be doing something like this,
If $User = && $SourceIP !=
then
Kick them out
fi.
So that the user can come via only one IP address, that satisfy my requirement.
Rgds
Shahul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2008 06:50 AM
07-10-2008 06:50 AM