Dynamically ban ip after failed login


 
Thread Tools Search this Thread
Operating Systems Solaris Dynamically ban ip after failed login
# 1  
Old 12-19-2016
Dynamically ban ip after failed login

Hello,

I need some help with network/firewall settings in Solaris 11.3.

What I want to achieve is that if someone tries to log in to my server and fails I want that IP to be banned for some time.

So if a computer/user tries to login to my ssh-server on a specified port (normally 22) and have for example 3 failed attempts in 5 minutes, the IP should be blocked for a set time, lets say 10 minutes, and then be opened again if no further login attempts are made.

This seems to be fairly easy to do with iptables and two rows of code, and is something my 8+ year old 4-bay nas is able to do via GUI, but in Solaris I cannot find a clear answer to how to achieve this.

I would like to apply this to more services than just ssh, and for ssh I have tried to use the option MaxAuthTries which I haven't seen any effect of at all.

The closest I have seen in Solaris is to use IPfilter (IP Filter Configuration File Examples - Securing the Network in Oracle Solaris 11.1), but as far as I can see it is just used to statically open or close ports to certain preset addresses.

I found a article at Creating a fairly secure public SSH daemon | Rants about the Solaris OS which seems to do almost what I want, but it looks a little clumsy compared to iptables and it does not dynamically "release" an IP after the set time unless you run the script manually or via cron. And it seems to work with ssh due to the way ssh works and hence is not very flexible for other services on the server.

I cannot be the first one to wonder this and I would be really surprised if Solaris who claims to be a cloud os is not able to do this.
# 2  
Old 12-20-2016
I have been using a program called DenyHosts. It is a python script that is very configurable and will do exactly what you want.

http://denyhosts.sourceforge.net/
# 3  
Old 12-21-2016
I will check out denyhosts.
But that this mean that this cannot be achieved with Solaris own firewall system?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Reset failed login count

Hi, Can someone tell me the command to do this in solaris 5.10 please? I've trawled around the internet for ages but all I can find is the AIX command... Thanks (2 Replies)
Discussion started by: Grueben
2 Replies

2. AIX

Clear failed login count

What's actually the difference between these two command: 1) chsec -f /etc/security/lastlog -a "unsuccessful_login_count=0" -s username 2) chuser unsuccessful_login_count=0 username Are there any impact on executing either one of those command to clear/reset the failed login count in AIX?... (2 Replies)
Discussion started by: ph4nt0m227
2 Replies

3. Solaris

Console Login Failed..

Dear Unix Team, This is sudhansu once again. I need some tips on below issue. Sometimes we got calls from customer that their console got hangged means they are not able to access the server through console ip. in that case "resetsc -y" will resolve the issue. 2. But couple of days... (2 Replies)
Discussion started by: sudhansu
2 Replies

4. Solaris

Solaris 2.6 failed login logging

Holla! Sorry to spam the board with all my Solaris 2.6 questions (I just found this forum). My most recent problem is that not ALL failed log-ins are getting logged in /var/log/authlog. It seems to work fine for the "su" command from a non-root user, but the actual "login" command or a desktop... (4 Replies)
Discussion started by: rrossorr
4 Replies

5. Windows & DOS: Issues & Discussions

Application failed when remote login

I have an application (EXE file) in a Windows 2003 server. Through a DOS batch script, I called that application file using UNC path and working fine when locally login. But got failed when I tried the same batch script on remote login. The login id has been provided all the below rights: - Log on... (0 Replies)
Discussion started by: r_sethu
0 Replies

6. Solaris

problem during Recording Failed Login

Dears, i am trying to recording failed login this is the steps which i do:- 1) touch /var/adm/logilog 2) chown root:sys /var/adm/loginlog 3) chmod 600 /var/adm/loginlog ls -l /var/adm/loginlog -rw------- 1 root sys 0 Jul 21 03:52 /var/adm/loginlog 4) change this value in... (3 Replies)
Discussion started by: hosney00ux
3 Replies

7. Solaris

FTP login failed.

Hi guys, Can you please help me. I have SUN V100 server running solaris 8. I also have a Redhat Linux 6.2 machine and a windows XP machine on the network. I'm trying to copy files from the Linux and XP machines to the V100 server. When I try to ftp to the solaris machine, I'm challenged... (2 Replies)
Discussion started by: Stin
2 Replies

8. UNIX for Advanced & Expert Users

failed ssh login with keys

Hi all, i have generated a pair of keys so that i can login via SSH without entering my password. I am using putty to login. After putting the public key on the server,then logging through putty, i get the message "Server refused our key" on screen. At the same time, /var/log/secure is... (3 Replies)
Discussion started by: new2ss
3 Replies

9. Solaris

Last Failed Login

Hi, Would appreciate it if someone could shed me some light here as I'm yet to find any related information in this forum with regards to my problem. Basically, I would like to display "Last Unsuccessful login" information when a user successfully logs-in to the system. I can't seem to find... (2 Replies)
Discussion started by: gilberteu
2 Replies

10. AIX

failed login time limit

Hello, we had a situation where an account was locked out due to too many failed login attempts. From the logs (failedlogin, etc) it appears that AIX 'remembered' the failed login attempts from the past month or so. does anyone know where this is set, or how long it will remember the number of... (2 Replies)
Discussion started by: zuessh
2 Replies
Login or Register to Ask a Question