#!/usr/local/bin/perl # edit_users.cgi # Display user and group related SSHd options require './sshd-lib.pl'; &ui_print_header(undef, $text{'users_title'}, "", "users"); $conf = &get_sshd_config(); print "
\n"; print "\n"; print "\n"; print "
$text{'users_header'}
\n"; if ($version{'type'} eq 'ssh' && $version{'number'} < 2) { &scmd(); $expire = &find_value("AccountExpireWarningDays", $conf); print "\n"; &ecmd(); } $mail = &find_value("CheckMail", $conf); if ($version{'type'} eq 'ssh') { &scmd(); print "\n", lc($mail) eq 'no' ? "checked" : "", $text{'no'}; &ecmd(); } elsif ($version{'number'} < 3.1) { &scmd(); print "\n", lc($mail) eq 'yes' ? "" : "checked", $text{'no'}; &ecmd(); } # XXX are these supported? #$empty = &find_value("ForcedEmptyPasswdChange", $conf); #print "\n", # lc($empty) eq 'yes' ? "" : "checked", $text{'no'}; #$passwd = &find_value("ForcedPasswdChange", $conf); #print "\n", # lc($passwd) eq 'no' ? "checked" : "", $text{'no'}; if ($version{'type'} eq 'ssh' && $version{'number'} < 2) { &scmd(); $pexpire = &find_value("PasswordExpireWarningDays", $conf); print "\n"; &ecmd(); } if ($version{'type'} ne 'ssh' || $version{'number'} < 3) { &scmd(); $auth = &find_value("PasswordAuthentication", $conf); print "\n", lc($auth) eq 'no' ? "checked" : "", $text{'no'}; &ecmd(); } &scmd(); $pempty = &find_value("PermitEmptyPasswords", $conf); print "\n", lc($pempty) eq 'no' ? "checked" : "", $text{'no'}; } else { printf " %s\n", lc($pempty) eq 'yes' ? "checked" : "", $text{'yes'}; printf " %s\n", lc($pempty) eq 'yes' ? "" : "checked", $text{'no'}; } &ecmd(); &scmd(); $root = &find_value("PermitRootLogin", $conf); if (!$root) { # Default ways seems to be 'yes' $root = "yes"; } print "\n"; &ecmd(); if ($version{'type'} ne 'ssh' || $version{'number'} < 3) { &scmd(); $rsa = &find_value("RSAAuthentication", $conf); print "\n", lc($rsa) eq 'no' ? "checked" : "", $text{'no'}; &ecmd(); } &scmd(); $strict = &find_value("StrictModes", $conf); print "\n", lc($strict) eq 'no' ? "checked" : "", $text{'no'}; &ecmd(); &scmd(); $motd = &find_value("PrintMotd", $conf); print "\n", lc($motd) eq 'no' ? "checked" : "", $text{'no'}; &ecmd(); if ($version{'type'} eq 'openssh') { &scmd(); $known = &find_value("IgnoreUserKnownHosts", $conf); print "\n", lc($known) eq 'yes' ? "" : "checked", $text{'no'}; &ecmd(); if ($version{'number'} > 2.3) { &scmd(1); $banner = &find_value("Banner", $conf); print "\n"; &ecmd(); } } elsif ($version{'type'} eq 'ssh' && $version{'number'} >= 2) { &scmd(1); $banner = &find_value("BannerMessageFile", $conf); print "\n"; &ecmd(); } if ($version{'type'} eq 'openssh' && $version{'number'} >= 3) { &scmd(1); $authkeys = &find_value("AuthorizedKeysFile", $conf); print "\n"; &ecmd(); } &scmd(1); print "\n"; &ecmd(); if ($version{'type'} eq 'openssh' && $version{'number'} < 3.7 || $version{'type'} eq 'ssh' && $version{'number'} < 2) { &scmd(); $rhostsauth = &find_value("RhostsAuthentication", $conf); print "\n", lc($rhostsauth) eq 'yes' ? "" : "checked", $text{'no'}; &ecmd(); &scmd(); $rhostsrsa = &find_value("RhostsRSAAuthentication", $conf); print "\n", lc($rhostsrsa) eq 'no' ? "checked" : "", $text{'no'}; } else { printf " %s\n", lc($rhostsrsa) eq 'yes' ? "checked" : "", $text{'yes'}; printf " %s\n", lc($rhostsrsa) eq 'yes' ? "" : "checked", $text{'no'}; } &ecmd(); } &scmd(); $rhosts = &find_value("IgnoreRhosts", $conf); print "\n", lc($rhosts) eq 'yes' ? "" : "checked", $text{'no'}; } else { printf " %s\n", lc($rhosts) eq 'no' ? "" : "checked", $text{'yes'}; printf " %s\n", lc($rhosts) eq 'no' ? "checked" : "", $text{'no'}; } &ecmd(); if ($version{'type'} eq 'ssh') { &scmd(1); $rrhosts = &find_value("IgnoreRootRhosts", $conf); print "\n", $rrhosts ? "" : "checked", $text{'users_rrdef'}; &ecmd(); } print "
$text{'users_expire'} \n"; printf " %s\n", $expire ? "" : "checked", $text{'users_expire_def'}; printf "\n", $expire ? "checked" : ""; print "$text{'users_mail'} \n"; printf " %s\n", lc($mail) eq 'no' ? "" : "checked", $text{'yes'}; printf " %s$text{'users_mail'} \n"; printf " %s\n", lc($mail) eq 'yes' ? "checked" : "", $text{'yes'}; printf " %s
$text{'users_empty'} \n"; #printf " %s\n", # lc($empty) eq 'yes' ? "checked" : "", $text{'yes'}; #printf " %s$text{'users_passwd'} \n"; #printf " %s\n", # lc($passwd) eq 'no' ? "" : "checked", $text{'yes'}; #printf " %s
$text{'users_pexpire'} \n"; printf " %s\n", $pexpire ? "" : "checked", $text{'users_pexpire_def'}; printf "\n", $pexpire ? "checked" : ""; print "$text{'users_auth'} \n"; printf " %s\n", lc($auth) eq 'no' ? "" : "checked", $text{'yes'}; printf " %s$text{'users_pempty'} \n"; if ($version{'type'} eq 'ssh') { printf " %s\n", lc($pempty) eq 'no' ? "" : "checked", $text{'yes'}; printf " %s$text{'users_root'} $text{'users_rsa'} \n"; printf " %s\n", lc($rsa) eq 'no' ? "" : "checked", $text{'yes'}; printf " %s$text{'users_strict'} \n"; printf " %s\n", lc($strict) eq 'no' ? "" : "checked", $text{'yes'}; printf " %s$text{'users_motd'} \n"; printf " %s\n", lc($motd) eq 'no' ? "" : "checked", $text{'yes'}; printf " %s$text{'users_known'} \n"; printf " %s\n", lc($known) eq 'yes' ? "checked" : "", $text{'yes'}; printf " %s$text{'users_banner'} \n"; printf " %s\n", $banner ? "" : "checked", $text{'users_banner_def'}; printf "\n", $banner ? "checked" : ""; print "\n", &file_chooser_button("banner"),"$text{'users_banner'} \n"; printf " %s\n", $banner ? "" : "checked", $text{'users_banner_def'}; printf "\n", $banner ? "checked" : ""; print "\n", &file_chooser_button("banner"),"$text{'users_authkeys'} \n"; printf " %s\n", $authkeys ? "" : "checked", $text{'users_authkeys_def'}; printf "\n", $authkeys ? "checked" : ""; print "
$text{'users_rhostsauth'} \n"; printf " %s\n", lc($rhostsauth) eq 'yes' ? "checked" : "", $text{'yes'}; printf " %s$text{'users_rhostsrsa'} \n"; if ($version{'type'} eq 'ssh') { printf " %s\n", lc($rhostsrsa) eq 'no' ? "" : "checked", $text{'yes'}; printf " %s$text{'users_rhosts'} \n"; if ($version{'type'} eq 'ssh') { printf " %s\n", lc($rhosts) eq 'yes' ? "checked" : "", $text{'yes'}; printf " %s$text{'users_rrhosts'} \n"; printf " %s\n", lc($rrhosts) eq 'yes' ? "checked" : "", $text{'yes'}; printf " %s\n", lc($rrhosts) eq 'no' ? "checked" : "", $text{'no'}; printf " %s
\n"; print "
\n"; &ui_print_footer("", $text{'index_return'});