def do_set_ssh_password_authentication(self, line): """Toggle SSH password authentication """ print("\n SSH password authentication\n") prompt = "Enable SSH password authentication ([Y]es/[N]o)?" do_enable = self.__ask_yes_or_no(prompt) self.logger.debug("Setting SSH password authentication") security.Ssh().password_authentication(do_enable)
def do_set_ssh_password_authentication(self, line): print("\n SSH password authentication\n") self.do_get_ssh_password_authentication(line) prompt = "Enable SSH password authentication?" do_enable = self.__ask_yes_or_no(prompt) self.logger.debug("Setting SSH password authentication") is_enabled = security.Ssh().password_authentication(do_enable) state = ("enabled" if is_enabled else "disabled") self.logger.info("SSH password authentication is " "currently %s." % state)
def __init__(self, path, title): super(HostkeyDialog, self).__init__(path, title, []) ssh = security.Ssh() fp, hk = ssh.get_hostkey() self.children = [ ui.Label("hostkey.label[0]", "RSA Host Key Fingerprint:"), ui.Label("hostkey.fp", fp), ui.Divider("hostkey.divider[0]"), ui.Label("hostkey.label[1]", "RSA Host Key:"), ui.Label("hostkey", "\n".join(textwrap.wrap(hk, 64))), ] self.buttons = [ui.CloseButton("dialog.close")]
def do_get_ssh_password_authentication(self, line): is_enabled = security.Ssh().password_authentication() status = "enabled" if is_enabled else "disabled" self.logger.info("SSH password authentication is currently %s" % status)