| OS X - Operating System General OS operation information and support |
| Post Reply | New Thread | Subscribe |
|
|
Thread Tools |
![]() Member Since: Jan 15, 2010
Posts: 8
![]() |
Hey guys, I'm trying to figure out if there's a way that I can lock down SSH access into my iMac based on originating IP. In *nix you'd just edit the /etc/hosts.allow file with something like this:
sshd : 192.168.1.0/255.255.255.0 : ALLOW But that doesn't seem to be working. I'm actually having a hard time finding information on this so forgive me if this is a common question that I'm just not finding the answer to. If that's the case, can you point me to the documentation/thread/guide? Thanks in advance! |
| QUOTE Thanks | |
![]() Member Since: Oct 19, 2008
Location: Ottawa
Posts: 15,289
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Mac Specs: 2012 13" MBP (2.5 i5, 8GB)
|
Important Links: Community Guidelines : Use the reputation system if you've been helped. M-F Blog :: Write for the blog :: M-F IRC Channel - Chats every Sunday at 8PM EST. |
| QUOTE Thanks | |
![]() Member Since: Jan 15, 2010
Posts: 8
![]() |
Quote:
I just tried restarting it to have the changes take effect: no dice. I also tried a few different versions of the hosts.allow line (not all at once, one at a time): sshd : 192.168.1.0/255.255.255.0 : ALLOW sshd : 192.168.1.0/255.255.255.0 ssh : 192.168.1.0/255.255.255.0 : ALLOW ssh : 192.168.1.0/255.255.255.0 |
|||||
| QUOTE Thanks | ||||||
![]() Member Since: Oct 19, 2008
Location: Ottawa
Posts: 15,289
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Mac Specs: 2012 13" MBP (2.5 i5, 8GB)
|
You don't have a hosts.deny do you?
Try this: 1. Setup a hosts.deny to see if that works (if it does, we know ssh is picking it up). 2. Try removing the subnet mask from the host section of your hosts.allow rule. Also, something I just noticed know: why is the IP 192.168.1.0? That looks like it could be a router address. Important Links: Community Guidelines : Use the reputation system if you've been helped. M-F Blog :: Write for the blog :: M-F IRC Channel - Chats every Sunday at 8PM EST. |
| QUOTE Thanks | |
![]() Member Since: Jul 02, 2007
Location: Going Galt...
Posts: 3,124
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Mac Specs: MacBookAir5,2:10.8.3-MacMini3,1:10.8.3-iPhone3,1:6.1.3
|
,_____o00o _ //___l__,\____\,__ l_--- \___l---OlllllllO (o)_)-o- (o)_)--o-)_) |
| QUOTE Thanks | |
![]() Member Since: Jan 15, 2010
Posts: 8
![]() |
Quote:
The host.deny file DOES work. I had this line in the hosts.deny: sshd : ALL As for the IP, it's not really the IP scope I'm using. I just don't like posting my real IP info ![]() Hrmmm, why isn't the allow working... |
|
| QUOTE Thanks | ||
|
Member Since: Feb 26, 2010
Location: Rocky Mountain High, Colorado
Posts: 2,116
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Mac Specs: 1.8 GHz i7 MBA 11" OSX 10.8.2
|
Have you seen this article?
HOWTO - Limiting Access to TCP-wrapped Services With hosts.allow Also - what doesn't work? Are you saying that you try logging in to your machine through SSH it doesn't let you, or are you trying from an out of bounds IP and it still lets you? I do the same as XJ-linux - I lock down ssh to only be able to log in with rsa keys. edit You posted the answer to my questions faster than I could ask. Also - did you remove the sshd:ALL from your hosts.deny file? I believe this will override anything in hosts.allow |
| QUOTE Thanks | |
![]() Member Since: Jul 02, 2007
Location: Going Galt...
Posts: 3,124
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Mac Specs: MacBookAir5,2:10.8.3-MacMini3,1:10.8.3-iPhone3,1:6.1.3
|
,_____o00o _ //___l__,\____\,__ l_--- \___l---OlllllllO (o)_)-o- (o)_)--o-)_) |
| QUOTE Thanks | |
![]() Member Since: Jan 15, 2010
Posts: 8
![]() |
Quote:
When I say it isn't working I mean to say that I'm still able to SSH in from servers that are not in my hosts.allow. After adding the hosts.deny entry, it doesn't matter what I do with hosts.allow, everything gets rejected, so yeah, it overrides it apparently. If I can't get this to work, it won't be terribly inconvenient to go the authorized keys route. |
|
| QUOTE Thanks | ||
|
Member Since: Feb 26, 2010
Location: Rocky Mountain High, Colorado
Posts: 2,116
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Mac Specs: 1.8 GHz i7 MBA 11" OSX 10.8.2
|
|
| QUOTE Thanks | |
![]() Member Since: Jan 15, 2010
Posts: 8
![]() |
Okay, I figured it out. Mostly, the problem was due to my stupidity
![]() Long story, short, a change was made to the network last week so I'm actually hitting the iMac from a different IP than I'm used to, the one I added to the hosts.allow. That having been said, I found that I still needed to add "sshd : ALL : deny" to hosts.deny and "sshd : <IP> : allow" to the hosts.allow for it to work correctly. Thanks for the help guys, sorry for wasting any of your time. |
| QUOTE Thanks | |
![]() Member Since: Jul 02, 2007
Location: Going Galt...
Posts: 3,124
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Mac Specs: MacBookAir5,2:10.8.3-MacMini3,1:10.8.3-iPhone3,1:6.1.3
|
Not a waste. Good thread, and more stimulating than: Will more RAM make my Mac faster?
,_____o00o _ //___l__,\____\,__ l_--- \___l---OlllllllO (o)_)-o- (o)_)--o-)_) |
| QUOTE Thanks | |
| Post Reply | New Thread | Subscribe |
| Thread Tools | |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
|
|||||||
Thread |
Thread Starter |
Forum |
Replies |
Last Post |
| SSH w/public key ibm/ubuntu to mac/snow leopard | abl7635 | Running Windows (or anything else) on your Mac | 0 | 07-07-2010 08:13 PM |
| ssh problem | bluesunquake | OS X - Apps and Games | 1 | 05-06-2009 09:13 PM |
| SSH problem... | moebius | OS X - Operating System | 2 | 11-17-2008 10:30 PM |
| Creating SSH tunnels in Leopard | morgandeano | OS X - Operating System | 2 | 02-06-2008 08:22 AM |
| Can anybody walk me through SSH and Firewalls using ARD | coincopy | OS X - Apps and Games | 0 | 01-27-2007 10:48 AM |
All times are GMT -4. The time now is 04:59 PM.
Powered by vBulletin