def check_channel_shell_request(self, channel): print("Shell requested") if 'root' in self.username: ps1 = '[root@localhost ~]# ' else: ps1 = '[{}@localhost ~]$ '.format(self.username) threading.Thread(target=noexceptwrap(interactive_shell), args=[TextChannel(channel, fix_incoming_endl=True), ps1]).start() return True
def check_channel_exec_request(self, channel, command): print("EXEC requested: {}".format(command)) threading.Thread(target=noexceptwrap(process_commandline), args=[TextChannel(channel, fix_incoming_endl=True), command]).start() return True