Allow editing of max login attempts per connection
authorJamie Cameron <jcameron@webmin.com>
Wed, 24 Feb 2010 00:41:21 +0000 (16:41 -0800)
committerJamie Cameron <jcameron@webmin.com>
Wed, 24 Feb 2010 00:41:21 +0000 (16:41 -0800)
sshd/CHANGELOG
sshd/edit_users.cgi
sshd/lang/en
sshd/save_users.cgi

index f700033..c66e7b9 100644 (file)
@@ -13,3 +13,5 @@ Added a button on the module's main page for viewing the public side of the host
 Added a field to allow or deny SSH 2 public key authentication.
 ---- Changes since 1.450 ----
 Converted all pages the use the new Webmin UI library, for a more consistent look and layout.
+---- Changes since 1.500 ----
+Added a field for editing the maximum login attempts per connection.
index 21287a3..a72f1ff 100755 (executable)
@@ -132,6 +132,14 @@ if ($version{'type'} eq 'openssh' && $version{'number'} >= 3) {
                                $text{'users_authkeys_set'}));
        }
 
+if ($version{'type'} eq 'openssh' && $version{'number'} >= 5) {
+       # Max login attempts
+       $maxauthtries = &find_value("MaxAuthTries", $conf);
+       print &ui_table_row($text{'users_maxauthtries'},
+               &ui_opt_textbox("maxauthtries", $maxauthtries, 5,
+                               $text{'default'}." (6)"));
+       }
+
 print &ui_table_hr();
 
 if ($version{'type'} eq 'openssh' && $version{'number'} < 3.7 ||
index 4cb9104..dda1718 100644 (file)
@@ -52,6 +52,9 @@ users_ebanner=Missing or invalid pre-login message file
 users_authkeys=User authorized keys file
 users_authkeys_def=Default (~/.ssh/authorized_keys)
 users_authkeys_set=File under home
+users_eauthkeys=Missing or invalid-looking authorized keys file
+users_maxauthtries=Maximum login attempts per connection
+users_emaxauthtries=Missing or non-numeric number of login attempts per connection
 
 net_title=Networking
 net_header=Networking options
index 8164e93..b919adc 100755 (executable)
@@ -93,6 +93,17 @@ if ($version{'type'} eq 'openssh' && $version{'number'} >= 3) {
                }
        }
 
+if ($version{'type'} eq 'openssh' && $version{'number'} >= 5) {
+       if ($in{'maxauthtries_def'}) {
+               &save_directive("MaxAuthTries", $conf);
+               }
+       else {
+               $in{'maxauthtries'} =~ /^\d+$/ && $in{'maxauthtries'} > 0 ||
+                       &error($text{'users_emaxauthtries'});
+               &save_directive("MaxAuthTries", $conf, $in{'maxauthtries'});
+               }
+       }
+
 if ($version{'type'} eq 'openssh' && $version{'number'} < 3.7 ||
     $version{'type'} eq 'ssh' && $version{'number'} < 2) {
        &save_directive("RhostsAuthentication", $conf,