After gaining initial access into a target system and through a reverse shell, the current shell you will have is a NON-INTERACTIVE (no TTY) shell, but commands like su requires INTERACTIVE TERMINAL (TTY) so you need to spawn a proper TTY shell.

You can upgrade the shell from the reverse shell with the following command:

python -c 'import pty; pty.spawn("/bin/bash")’

Set the column and rows (optional) for a better output presentation

stty cols 100 rows 40