- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Script to block any unauthorised user to login in ...
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
04-19-2011 10:27 PM
04-19-2011 10:27 PM
I have list of specific ip's from where i need to enable my prodcn access and block from the rest...
I know it can be done through ip filter , but downtime is the concern...and my network team is not that confident to do it on a network level...
root #/ >uname -a
HP-UX cedgedr3 B.11.23 U ia64 2366811051 unlimited-user license
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2011 10:57 PM
04-19-2011 10:57 PM
Re: Script to block any unauthorised user to login in a server..
If they use telnet, you need to define there
if they use ssh, define it there.
So, you can block specific IP ranges to access your server, instead of writing script to prevent users.
Shibin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2011 11:17 PM
04-19-2011 11:17 PM
Re: Script to block any unauthorised user to login in a server..
You mean an entry in /var/adm/inetd.sec will do it ??
for ex :
ssh allow 10.1.5.26
ssh deny 10.1.5.29
its not working for me....shibin ..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2011 11:18 PM
04-19-2011 11:18 PM
Re: Script to block any unauthorised user to login in a server..
Although SSH *can* be configured to run with inetd, that is *not* the default configuration for it. Normally sshd runs as a stand-alone daemon, so /var/adm/inetd.sec has no effect to it. Instead, you can configure access restrictions in sshd configuration file (if you're using HP-UX Secure Shell, the configuration file is at /opt/ssh/etc/sshd_config). See "man sshd_config" for the available options and further instructions.
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2011 11:26 PM
04-19-2011 11:26 PM
Re: Script to block any unauthorised user to login in a server..
i have also tried
SSH - edit sshd_config and add:
DenyUsers user1, user2 ...
but how do i deny all and then allow some specific ..ip's only...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2011 11:36 PM
04-19-2011 11:36 PM
Re: Script to block any unauthorised user to login in a server..
i was trying smthg like below;
VALID_IP="10.1.5.26 10.1.5.32"
for MYIP in $VALID_IP
do
MYIP=`who -TH |grep $USER |awk '{ print $NF}'|grep -v "COMMENTS" |uniq|xargs`
if [ "$MYIP" != "$VALID_IP" ];
then
echo Sorry, you are not authorized to access this server
sleep 8
exit
fi
done
after this in /etc/profile m still able to login from 10.1.5.29 IP...whose ip i have nt mentioned in my valip ip's list..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2011 11:40 PM
04-19-2011 11:40 PM
Re: Script to block any unauthorised user to login in a server..
then you need to define the allowed users with "AllowUsers". Only the users specified here will get access to the system per ssh. To be sure comment the DenyUsers directive, I'm not sure what's the effect if both are set.
Unix operates with beer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2011 12:00 AM - last edited on 08-02-2011 01:11 PM by Kevin_Paul
04-20-2011 12:00 AM - last edited on 08-02-2011 01:11 PM by Kevin_Paul
Re: Script to block any unauthorised user to login in a server..
> i was trying smthg like below;
> [...]
(thread deleted)
Some of the complaints and suggestions there
may still be valid here.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2011 12:03 AM
04-20-2011 12:03 AM
Re: Script to block any unauthorised user to login in a server..
I think i have got the answer.
unhashed
HostbasedAuthAllowUsers
HostbasedAuthDenyUsers from sshd_config file..
created /etc/hosts.deny with entry of ALL:ALL
created /etc/hosts.allow with entry of authorised ip's only.
start stop secureshell ..did it....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2011 09:23 AM - last edited on 08-02-2011 01:13 PM by Kevin_Paul
04-20-2011 09:23 AM - last edited on 08-02-2011 01:13 PM by Kevin_Paul
SolutionYou want 'tcp wrappers' which will block ssh before ssh can make a connection. And ssh will have to make a connection in order for the above solutions to work.
tcp wrappers works in a similar way that the above inetd.sec filter works, but it is more complicated to administer but covers exactly what you want it to do.
http://h30499.www3.hp.com/t5/System-Administration/TCP-wrapper-confign-to-limit-access-by-ip-s/m-p/4228858#M328350
http://h30499.www3.hp.com/t5/General/TCP-Wrappers-7-6-and-HP-UX-11-1/m-p/3166491#M86591
http://hpux.connect.org.uk/hppd/hpux/Networking/Admin/tcp_wrappers-7.6/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2011 04:38 AM
04-26-2011 04:38 AM
Re: Script to block any unauthorised user to login in a server..
Will try with that too...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2011 04:39 AM
04-26-2011 04:39 AM