(self, get)
return public.returnMsg(True, 'Closed successfully')
开启密码登陆
        get: 无需传递参数
开启密码登陆
        get: 无需传递参数
开启密码登陆 get : 无需传递参数
def stop_root(self, get):
        '''
        开启密码登陆
        get: 无需传递参数
        '''
        ssh_password = '\n#?PermitRootLogin\s\w+'
        file = public.readFile(self.__SSH_CONFIG)
        if len(re.findall(ssh_password, file)) == 0:
            file_result = file + '\nPermitRootLogin no'
        else:
            file_result = re.sub(ssh_password, '\nPermitRootLogin no', file)
        self.wirte(self.__SSH_CONFIG, file_result)
        self.restart_ssh()
        return public.returnMsg(True, 'Closed successfully')
def stop_root ( self , get ) : ssh_password = '\n#?PermitRootLogin\s\w+' file = public . readFile ( self . __SSH_CONFIG ) if len ( re . findall ( ssh_password , file ) ) == 0 : file_result = file + '\nPermitRootLogin no' else : file_result = re . sub ( ssh_password , '\nPermitRootLogin no' , file ) self . wirte ( self . __SSH_CONFIG , file_result ) self . restart_ssh ( ) return public . returnMsg ( True , 'Closed successfully' )