[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: problems with accessing X apps with ssh



On Friday 30 March 2007 03:57, Greg Folkert wrote:
> On Fri, 2007-03-30 at 01:14 +0200, Nigel Henry wrote:
> > I have to admit that I am confused when discussing clients, and servers
> > with working with SSH.
<Greg>
> Okay. You local GUI is the X-Server. It runs the display and all the GUI
> functions associated with it.
>
> When you execute a GUI application it becomes an X-Server client. It
> sends display info to the X-Server. The X-Server Renders it. In this
> case there is no remote machine.
>
> Now, let us say, you have your FC2 machine which you are sitting at. It
> has the X-Server running the GUI display. Let us call this the local
> machine. You have another machine sitting in the Data Center... lets
> call this the remote machine. In actuality you consider this to be the
> server, as all the *work* gets done there. Well, it is and it isn't.
> *IF* you want to display a GUI application on your local machine, the
> remote machine is then a client to your X-Server. This is were most
> people get confused. X is opposite of what you regularly think of. The
> GUI application started on the "server" is in reality a client to the
> X-server or the local GUI Display.
>
> Okay, try this form your FC2 machine:
>
>         ssh -X debian
>
> The -X tells ssh to ask for an X forwarded session and sets a remotely
> local $DISPLAY, usually with an X offset of 10 or 20, so it look like:
>
>         DISPLAY=localhost:10
>
> This is an X forwarded display on the remote machine to send all input
> to your local X-Server.
>
> Now right after that:
>
>         gedit &
>
> You should now get a gedit window on your local display which is the *X
> Server*. Remember gedit is an X-client (remote) to your X-Server
> (local).
>
> Now, remember this. If you want to automagically have this on Debian
> machine you sit at and use as an X-Server, you will need to set the
> config to carry the "-X" as a default.
>
> On the machine you sit at(the local machine)... the
> "/etc/ssh/ssh_config" will have to have a line like this:
>
>         ForwardX11 yes
>
> On the machine you ssh into (the remote machine), you will need to make
> sure an entry in "/etc/ssh/sshd_config" has entries that look like this:
>
>         X11Forwarding yes
>         X11DisplayOffset 10
>
> after changing the sshd_config, you will have to restart the openssh
> server using "/etc/init.d/ssh restart"
>
> It they both do not conform to these settings, you will not be able to
> get displays working the way you want.
>
> Remember please do not confuse the two files on the local and remote
> machines. They are:
>
>         /etc/ssh/ssh_config on the local machine.
>
>         /etc/ssh/sshd_config on the remote machine.
>
> If you still have issues, please respond back to this e-mail.
> --
> greg, greg@gregfolkert.net

Hi Greg. That was an easy fix. Thanks for the very good explanation. 
Everything is crystal clear now. While I was at it I changed the "Allow Root 
Login" line from yes to no, as I'd seen on a previous thread that this was 
not a good idea, and "yes" seems to be the default. I can always su to root 
once logged in, if I need to do anything as root.

Many thanks.

Nigel.
>
> I don't mow my lawn anymore. I just intimidate it into not growing.
> Though it is quite hard to intimidate grass, it has been around a long time
> and has quite an attitude about it.

Goats are good to keep the grass mowed, and if you have the one with the 
correct bits underneath it, you can turn your grass into milk, and cheese.



Reply to: