Ubuntu – Reverse X11 forwarding

sshx11-forwarding

I was playing with my phone (that runs a Linux/X stack) last night and I managed to ssh into my desktop and run an application and have it show up on my phone. It was awesome.

Today I'd like to sort of do the opposite. I want to view an application running on my phone on my PC. I could install a SSH server on my phone but I frankly don't fancy that purely for security reasons. I want this to be initiated from my phone.

Is there a way to connect from my phone and tunnel the PC's X connection back to the phone and then run an application on the phone that show on the PC?

Best Answer

"reverse ssh tunnelling" or "remote port forwarding" is your friend.

issue this on the phone

ssh -f -N -X -R 5555:localhost:22 desktop_user@desktop

then, on the desktop this

ssh -X -p 5555 phone_user@localhost

Related Question