How to get access to shell on the remote computer that don’t have “white”(“real” or “public”) IP without any additional software in linux?
Quick and dirty solution:
on server side:
1 2 3 4 |
mkfifo /tmp/p0.0 mkfifo /tmp/p0.1 screen sh -c 'cat < /tmp/p0.1 & cat > /tmp/p0.0' #now you can detach this from current console and attach it back when you want it |
on client side:
1 2 |
mkfifo /tmp/localpipe ssh -p 22 my.host.name 'cat < /tmp/p0.0 & cat > /tmp/p0.1' < /tmp/localpipe | bash > /tmp/localpipe |
pipe ‘/tmp/localpipe’ used to redirect bash output back to ssh
note: use exit command to stop redirection