X-Applications over SSH in Android

user1733435 picture user1733435 · Oct 10, 2012 · Viewed 78.7k times · Source

I would like to ask about running X-applications via SSH as follows.

I have Linux Desktop running SL6.3 with Gnome 2x. On Android tablet running CM9,I have Connectbot and X-Server for Android. I can logged into Linux box with Connectbot via SSH successfully.

I set up the options for X-forwarding in /etc/ssh/sshd_config on Linuxbox.(X11Forwarding yes).

Now when I use the -X option, ssh -X username@hostname:port , Connectbot repeatly asking password even I supplied a correct one,and says- 'Authentication method 'password' failed.

How could I successfully run X-applications over SSH in the tablet ? The environment is home wireless network.

Answer

Kevin Fries picture Kevin Fries · Feb 27, 2015

I know this thread is old... but, I wanted to make sure I clarified something misleading in paulsm4's answer...

X is backwards... You do not connect to an X server. You run the server on your local machine (what he is calling the client is actually the server). When you connect to a remote Nix box that has the X libs installed, and you add the -X switch to your SSH command, ssh will forward X requests back to you. The program running on the other side (Gnome, Chrome, PyCharm, etc) will be your X Client, and it will be upstreamed back to your desktop that contains the X Server. Here it is as a sequence Diagram:

User                                         Remote
-----------------------------------------------------------------------
User Inits SSH -X Session -----------------> SSH Server Auth User
                                                      |
                                                      V
SSH Session is established <---------------- SSH User is Authenticated
             |
             V
User Initiates App on server --------------> App Starts Running
                                                      |
                                                      V
                                             App Writes output to X Server
                                                      |
                                                      V
Xorg receives write commands <-------------- SSH Tunnels that back to User
             |
             V
Writing occurs on desktop
-----------------------------------------------------------------------

Most of the time, the X Server and X Client are the same (as happens on your local Desktop). Therefore, once the client writes to X, the local X server writes to the screen. The display process is actually done on the user's computer, where-ever it is, your computer becomes the server. Crazy ain't it?