# Spawn PTY$ifpython3-V>/dev/null2>&1; thenpython3-c'import pty; pty.spawn("/bin/bash")'elifpython-V>/dev/null2>&1; thenpython-c'import pty; pty.spawn("/bin/bash")'fiOr$script-q/dev/null/bin/bash# Background remote shelluser@remote:~$^Z# Get rows and cols from local terminalroot@kali:~$stty-a|head-n1|cut-d';'-f2-3|cut-b2-|sed's/; /\n/'# Disable local output in terminalroot@kali:~$sttyraw-echo; fg# (optional) Reset remote terminaluser@remote:~$reset# Set rows and columns for proper text aligninguser@remote:~$sttyrows ${ROWS} cols ${COLS}# For CTRL-L to workuser@remote:~$exportTERM=xterm/xterm-color/xterm-256color# (optional) Get Bash new process imageuser@remote:~$exec/bin/bash [-l]