Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mx12

macrumors newbie
Original poster
Oct 25, 2008
18
0
I like having remote login turned on, but I have always notice that in my secure.log, there are always a lot of unauthorized ssh attempts. I realize that this is a dictionary attack because who ever is doing this users names like root, bob, mike ....

I was wondering if there was a way to "Blacklist" the ip address of those who are running a dictionary attack on my me? Preferably a way to automatically add an ip address after x number of failed attempts to some blacklist.

Thanks
 

ChrisA

macrumors G5
Jan 5, 2006
12,584
1,701
Redondo Beach, California
I like having remote login turned on, but I have always notice that in my secure.log, there are always a lot of unauthorized ssh attempts. I realize that this is a dictionary attack because who ever is doing this users names like root, bob, mike ....

I was wondering if there was a way to "Blacklist" the ip address of those who are running a dictionary attack on my me? Preferably a way to automatically add an ip address after x number of failed attempts to some blacklist.

Thanks

Certainly that is the reason there are /etc/hosts/allow and /etc/hosts/deny files on your computer.

Read the hosts_access(5) man pages. You can have both a black list or a white list. The white list is safer.

type "man 5 hosts_access" in the terminal for more info.

BTW this works the same way on all Unix-like systems So if you Googel and it takes you to a Solars or Linix forum, that info applies here too.
 

ChrisA

macrumors G5
Jan 5, 2006
12,584
1,701
Redondo Beach, California
I run Denyhosts on my linux box which works great. The author says it should work on OS X with some configuration changes, but I haven't tried it. Give it a go.

Of course it will work on OS X. All you do is edit /etc/host.deny with any text editor. Read the man page for sshd. This is handled by "tcp wrappers" which ships with Mac OS. Maybe there is some program that edits the files for you but you don't need it.
 

CarpetMonster

macrumors newbie
Jun 13, 2007
21
0
Of course it will work on OS X. All you do is edit /etc/host.deny with any text editor. Read the man page for sshd. This is handled by "tcp wrappers" which ships with Mac OS. Maybe there is some program that edits the files for you but you don't need it.

Umm, I know how it works thank you. I was merely suggesting it and offering the disclaimer that I hadn't actually tried it on OS X.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.