Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Use ssh X forwarding on vanilla ubuntu desktop install?

  1. #1
    Join Date
    May 2008
    Location
    Baker, OR USA
    Beans
    886
    Distro
    Ubuntu Development Release

    Use ssh X forwarding on vanilla ubuntu desktop install?

    I want to be able to login to my computer graphically when someone else is it the physical computer and to be able to use it without getting in each others way. I've tried to read up on ssh X forwarding, but I can't seem to get it. I would like to be able to not interrupt the normal X on both computers if that's possible. To that end, I've tried to use xepher, but couldn't figure out how to fit the pieces together. Thanks in advance, I've read so many tutorials that didn't work and I'm ready for some two-way help.
    Last edited by SoftwareExplorer; August 13th, 2009 at 10:08 PM. Reason: spelling correction
    I don't want to Live in a Life without Walls-too many viruses get in...
    Ubuntu user 23101 Linux user 472132
    Two ways to live: the choice we all face

  2. #2
    Join Date
    May 2008
    Location
    Baker, OR USA
    Beans
    886
    Distro
    Ubuntu Development Release

    Re: Use ssh X forwarding on vanilla ubuntu desktop install?

    From what I've read, it should be easy. but I'm not getting something basic right or something.
    I don't want to Live in a Life without Walls-too many viruses get in...
    Ubuntu user 23101 Linux user 472132
    Two ways to live: the choice we all face

  3. #3
    Join Date
    Feb 2008
    Location
    London
    Beans
    1,032
    Distro
    Ubuntu

    Re: Use ssh X forwarding on vanilla ubuntu desktop install?

    Just run on the client:

    Code:
    ssh -X user@server
    Enter your password and run any program you like, graphical or not. That includes the gnome panel, metacity, compiz, whatever. Tip: if you don't need compression (I think it's that) you can use -Y instead of -X.
    Server: 2.2GHz Athlon 64; 4GB; 2TB; Debian 5 x64
    LividEmperor: 3.3GHz i5 2500K; 8GB; 660GB; Ubuntu 10.10 x64 + Windows 7 x64
    Netbook1: 1.6GHz Atom; 2GB; 160GB; Ubuntu 10.10 x86
    Dogeatdog: 3GHz Phenom II; 3GB; 1TB; Windows 7 x64

  4. #4
    Join Date
    May 2008
    Location
    Baker, OR USA
    Beans
    886
    Distro
    Ubuntu Development Release

    Re: Use ssh X forwarding on vanilla ubuntu desktop install?

    Quote Originally Posted by fela View Post
    Just run on the client:

    Code:
    ssh -X user@server
    Enter your password and run any program you like, graphical or not. That includes the gnome panel, metacity, compiz, whatever. Tip: if you don't need compression (I think it's that) you can use -Y instead of -X.
    Thanks for the help. It gives me this
    Code:
    ssh bjorn-backup
    bjorn@bjorn-backup's password: 
    Linux bjorn-backup 2.6.28-15-generic #49-Ubuntu SMP Tue Aug 18 18:40:08 UTC 2009 i686
    
    The programs included with the Ubuntu system are free software;
    the exact distribution terms for each program are described in the
    individual files in /usr/share/doc/*/copyright.
    
    Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
    applicable law.
    
    To access official Ubuntu documentation, please visit:
    http://help.ubuntu.com/
    
    0 packages can be updated.
    0 updates are security updates.
    
    Last login: Sat Aug 15 22:43:13 2009 from 192.168.0.120
    bjorn@bjorn-backup:~$ exit
    logout
    Connection to bjorn-backup closed.
    bjorn@bjorn-desktop:~$ ssh -X bjorn@bjorn-laptop
    bjorn@bjorn-laptop's password: 
    Linux bjorn-laptop 2.6.28-14-generic #47-Ubuntu SMP Sat Jul 25 01:19:55 UTC 2009 x86_64
    
    The programs included with the Ubuntu system are free software;
    the exact distribution terms for each program are described in the
    individual files in /usr/share/doc/*/copyright.
    
    Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
    applicable law.
    
    To access official Ubuntu documentation, please visit:
    http://help.ubuntu.com/
    
    *** System restart required ***
    Last login: Tue Aug 18 21:12:20 2009 from bjorn-desktop.local
    /usr/bin/X11/xauth:  /home/bjorn/.Xauthority not writable, changes will be ignored
    bjorn@bjorn-laptop:~$ gedit
    X11 connection rejected because of wrong authentication.
    
    (gedit:13896): Gtk-WARNING **: cannot open display: localhost:10.0
    bjorn@bjorn-laptop:~$
    Do you know what I'm doing wrong? I'm already running X on both of them (thats what I meant when I said vanilla ubuntu installs) when I run the command, is that a problem?
    I don't want to Live in a Life without Walls-too many viruses get in...
    Ubuntu user 23101 Linux user 472132
    Two ways to live: the choice we all face

  5. #5
    Join Date
    Feb 2008
    Location
    Massachusetts, USA
    Beans
    254
    Distro
    Kubuntu 12.04 Precise Pangolin

    Re: Use ssh X forwarding on vanilla ubuntu desktop install?

    Have you tried xhost+ on the machine your ssh'ing from?
    P5W-DH, E6750, Patriot Viper 4x2GB 1066, Seasonic M12 500w
    Creative Audigy, EVGA GTX 460, HP 2509m
    Kubuntu 12.04 64-bit (KDE 4.8.1)

  6. #6
    Join Date
    Feb 2008
    Location
    London
    Beans
    1,032
    Distro
    Ubuntu

    Re: Use ssh X forwarding on vanilla ubuntu desktop install?

    I'm sure the .Xauthority thing must mean something. Also, it says you need to reboot. Why don't you try that first?
    Server: 2.2GHz Athlon 64; 4GB; 2TB; Debian 5 x64
    LividEmperor: 3.3GHz i5 2500K; 8GB; 660GB; Ubuntu 10.10 x64 + Windows 7 x64
    Netbook1: 1.6GHz Atom; 2GB; 160GB; Ubuntu 10.10 x86
    Dogeatdog: 3GHz Phenom II; 3GB; 1TB; Windows 7 x64

  7. #7
    Join Date
    May 2008
    Location
    Baker, OR USA
    Beans
    886
    Distro
    Ubuntu Development Release

    Re: Use ssh X forwarding on vanilla ubuntu desktop install?

    Tried rebooting. Can't seem to figure out the Xauthority thing.

    How would I use xhost.

    PS:When you explain, can you make clear the difference of steps to do on the server and on the client?
    I don't want to Live in a Life without Walls-too many viruses get in...
    Ubuntu user 23101 Linux user 472132
    Two ways to live: the choice we all face

  8. #8
    Join Date
    Oct 2006
    Beans
    16

    Cool Re: Use ssh X forwarding on vanilla ubuntu desktop install?

    I am having the same problem. I have X installed on two Ubuntu 8.04 machines, and I get the same Gtk error complaining about being unable to open the display. That message is not surprising in a way because when I ssh in using
    Code:
    ssh -X host@remote
    , the DISPLAY environment variable does not even exist! When I ssh to a Debian testing machine I have access to with -X, DISPLAY is set as it should be, and X forwarding works fine, and I can launch xterm and gedit just fine.

    I have also checked the /etc/ssh/sshd_config and /etc/ssh/ssh_config ssh client and server config files on both ubuntu machines and all have X11 forwarding enabled. What gives?

  9. #9
    Join Date
    Oct 2006
    Beans
    16

    Re: Use ssh X forwarding on vanilla ubuntu desktop install?

    Fixed it! Just install the xauth package.

    The solution is revealed upon reading /usr/share/doc/ssh/README.Debian.gz under the section "X11 Forwarding". You just need to install the 'xauth' package - this could be a dependency of ssh, but since X11 forwarding is turned off by default now, xauth is only a "Suggested" dependency of ssh, but is a required dependency of xorg.

    So in summary:
    1. ensure the remote machine's /etc/ssh/sshd_config file has the line "ForwardX11 yes"
    2. Install xauth on the remote machine
    3. install the X apps on the remote machine that you wish to run
    4. Enjoy...

    One way to also test if things are working is to install x11-apps. It comes with basic programs for testing the forwarding like xclock and xeyes.

  10. #10
    Join Date
    May 2008
    Location
    Baker, OR USA
    Beans
    886
    Distro
    Ubuntu Development Release

    Re: Use ssh X forwarding on vanilla ubuntu desktop install?

    I don't know if this is safe, but I tried removing ~/.Xauthority ~/.Xauthority-c ~/.Xauthority-l on both of the machines. I restarted the server and it worked. However GTK programs are ugly except for gnome-appearance-preferences. gnome-terminal gave me
    Code:
    Failed to contact the GConf daemon; exiting.
    What does that mean?
    I don't want to Live in a Life without Walls-too many viruses get in...
    Ubuntu user 23101 Linux user 472132
    Two ways to live: the choice we all face

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •