![]() ![]() Local_bind_address=('localhost', 6543)) as tunnel: Remote_bind_address=(DATABASE, DATABASE), """Test data parse from remoted database.""" Self.local_bind_port = self.tunnel_object.local_bind_port Return False, "Failed to create the SSH tunnel." \ Remote_bind_address=(self.host, self.port) Ssh_private_key_password=tunnel_password, Ssh_pkey=get_complete_file_path(self.tunnel_identity_file), (self.tunnel_host, int(self.tunnel_port)), # If authentication method is 1 then it uses identity file Return False, "Failed to decrypt the SSH tunnel " \ # password is in bytes, for python3 we need it in string # Handling of non ascii password (Python2) Tunnel_password = decrypt(tunnel_password, user.password) ![]() If tunnel_password is not None and tunnel_password != '': ![]() Return False, gettext("Unauthorized request.") :return: True if tunnel is successfully created else error message. IP Address and port to localhost and the local bind port return by the This method is used to create ssh tunnel and update the IP Address and nsaje("No se ha podido ejecutar cups", "Atencion", atencion)ĭef create_ssh_tunnel(self, tunnel_password): Notebook.append_page(scrolledwindow, tab_label) Tab_nnect("close-clicked", tablabel.on_close_clicked, notebook, page) Tab_label = tablabel.TabLabel("CUPS " ip, _from_file("/usr/share/grx/icons/cups32.png")) Puerto_local = str(server.local_bind_port) Server = SSHTunnelForwarder((ip, puerto), ssh_username=usuario, ssh_private_key=ssh_path, remote_bind_address=('127.0.0.1', 631)) Sudo('sed -i."old" "/Require user /etc/cups/nf sed -i."old2" "/AuthType Default/d" /etc/cups/nf /etc/init.d/cups reload') With settings(host_string=ip, port=puerto, password=password, user=usuario): #Borra en el archivo nf la autentificacion Def on_Btn_cups_clicked(self, widget, ip, usuario, password, puerto, notebook, spinner, estado): ![]()
0 Comments
Leave a Reply. |