1
2
I have a machine behind a firewall. It's my machine, I have set up ssh, but it's completely firewalled. My solution has been to use a reverse shell set up on a cron basis to reconnect if it fails using netcat. The command is bash -i >& /dev/tcp/myhostname.duckdns.org/10000 0>&1
and on my local computer nc -l 10000
. Up until now this has worked, because I can tell it to join my private VPN with a command. For some reason that command isn't working. So, I'm able to "login" via the spawned bash shell but I cannot ssh back to my computer because Pseudo-terminal will not be allocated because stdin is not a terminal.
and I haven't set up ssh keys on that system ever, and it won't let me log in with a password.
So I've been trying to find a solution using netcat but have been unsuccessful. What I am envisioning is something like this:
[server] ---netcat--> [my-computer:port1]
such that I can piggyback off that to log in to the sshd server and fix whatever needs fixing. But I can't figure out the netcat commands that would accomplish that. Any help?