LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 03-01-2007, 10:50 PM   #1
longnam
Member
 
Registered: Mar 2005
Posts: 69

Rep: Reputation: 15
Access allow and deny to APACHE & SSH


Hi all,
I'm running a sparc 100 with Sun Solaris version 9. I also have apache and ssh running in the background. I would like to know how to deny all the access to my server from all DNS except for a couples ip which I want to give access to. I have created 2 files
"hosts.deny (ALL: ALL)" AND "hosts.allow (All: LOCAL 10.0.0.0/255.255.255.0) "
But It doesn't block any ip coming from apache or ssh at all. what do I need to configure for this works ?

many thanks
 
Old 03-02-2007, 02:02 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
The hosts.allow, hosts.deny method work only for the services that run through inetd (using tcp wrappers). So either you use inetd to start the 2 services, or use iptables to control the access to them. For apache you can also use .htaccess to control who can access it.

Regards
 
Old 03-02-2007, 05:43 AM   #3
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
iptables isn't available on Solaris 9 or in 10+, for at least licensing issues.

If you go the firewall way, Solaris 9 includes SunScreen.
 
Old 03-02-2007, 06:09 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
iptables isn't available on Solaris 9 or in 10+, for at least licensing issues.
iptables is based on linux kernel, that's why is not available on Solaris. On Solaris you can use ipfilter instead.

Regards
 
Old 03-02-2007, 07:43 AM   #5
Dox Systems - Brian
Member
 
Registered: Nov 2006
Posts: 344

Rep: Reputation: 31
Apache and SSH can be compiled to be tcpwrapper aware (and are typically compiled that way, at least on other platforms...). I've never tried to implement tcpwrappers on Solaris.
 
Old 03-02-2007, 07:59 AM   #6
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Do you use openssh? The config file may be in a different location than /etc/ssh/sshd_config if you use a commercial version of ssh. Ssh might be compiled with tcp-wrappers so you can use the config file to control access.

Look at the AllowUsers entry. It will deny all other users.

Also read the allow.hosts manpage. You said that you only want to allow access from two hosts to apache and ssh, but your config allows all hosts on the 10/8 network access to all services. I think that access control would be better controlled in the apache configuration as well.

Last edited by jschiwal; 03-02-2007 at 08:03 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ssh: deny all users, except one hamish Linux - Security 13 09-07-2008 07:58 PM
deny ssh access with pam RobertCraven Linux - Security 5 05-12-2006 03:55 AM
deny ssh access from lan with iptables NuLLiFiEd Linux - Security 10 12-01-2005 07:11 PM
how to deny ssh for ip range? maginotjr Slackware 11 11-01-2005 07:01 AM
ssh and /etc/hosts.all & deny tebucky Linux - Security 8 01-27-2005 05:23 PM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 06:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration