This is a discussion on ssh with X forwarding within the Slackware Linux Support forums, part of the Unix Operating Systems category; --> how do i use ssh with X forwarding/ ive tried: ssh -X 10.0.0.1 but if i try kdetv or ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| how do i use ssh with X forwarding/ ive tried: ssh -X 10.0.0.1 but if i try kdetv or xawtv it says bash-2.05b# ssh -X 10.0.0.2 root@10.0.0.2's password: Last login: Wed Apr 21 19:01:14 2004 from 10.0.0.1 Linux 2.4.22. Why is it taking so long for her to bring out all the good in you? root@lizard:~# kdetv kdetv: cannot connect to X server root@lizard:~# xawtv This is xawtv-3.90, running on Linux/i586 (2.4.22) Error: Can't open display: root@lizard:~# |
| |||
| Matthew Robinson wrote: > how do i use ssh with X forwarding/ > > ive tried: > > ssh -X 10.0.0.1 > > but if i try kdetv or xawtv it says > > bash-2.05b# ssh -X 10.0.0.2 > root@10.0.0.2's password: > Last login: Wed Apr 21 19:01:14 2004 from 10.0.0.1 > Linux 2.4.22. > > Why is it taking so long for her to bring out all the good in you? > > root@lizard:~# kdetv > kdetv: cannot connect to X server > root@lizard:~# xawtv > This is xawtv-3.90, running on Linux/i586 (2.4.22) > Error: Can't open display: > root@lizard:~# the problem is simple. when you log in as a regular user - you own the display. after that when you su to root - you only have a terminal, no display. therefore you cannot open the display if you try to connect from root user remotely, and use X forwarding. what you need to do is either: 1. log in as a regular user, then ssh -X blabla and run remotely xeyes. if you see the xeyes - everything is ok. [it should] or: 1. open a terminal for your regular user, run: xhost + 127.0.0.1 2. run: echo $DISPLAY 3. copy the value. 4. su to root, and there [depending on the shell] - define a variable DISPLAY and set it to the copied value. export/setenv it. test the work by running "xeyes" as root. you should see the stupid xeyes eyes. 5. now connect: ssh bla@112.123.123.1 -X 6. and run: xeyes. this will work. |
| |||
| In the .ssh directory in your home directory edit the file config and put these in it: Host hostname-you're-connecting-to Compression yes ForwardX11 yes Protocol 2, 1 User your-user-name-on-the-host Host * Forward X11 no That should do it (and you don't have to do the -X thing). Repeat the first for every system you connect to by name, be sure the "Host * and Forward X11 no" is the last entry in the file. While you're at it, put the hostname and address in your /etc/hosts... Matthew Robinson wrote: >how do i use ssh with X forwarding/ > >ive tried: > >ssh -X 10.0.0.1 > >but if i try kdetv or xawtv it says > >bash-2.05b# ssh -X 10.0.0.2 >root@10.0.0.2's password: >Last login: Wed Apr 21 19:01:14 2004 from 10.0.0.1 >Linux 2.4.22. > >Why is it taking so long for her to bring out all the good in you? > >root@lizard:~# kdetv >kdetv: cannot connect to X server >root@lizard:~# xawtv >This is xawtv-3.90, running on Linux/i586 (2.4.22) >Error: Can't open display: >root@lizard:~# > > > |
| ||||
| On Wed, 21 Apr 2004 19:02:24 +0100, Matthew Robinson wrote: > how do i use ssh with X forwarding/ "man sshd_config", look for "X11Forwarding". "mcedit /etc/ssh/sshd_config" and make the change. "/etc/rc.d/rc.sshd restart" to apply it. Then reconnect and try again. You might also want to check out "man ssh" and play with "-v" to get verbose command output. Almost every command you might try has such an option for verbose output. Every GNU command supports "--help" for a rundown of command syntax, as do most others, including ssh. > bash-2.05b# ssh -X 10.0.0.2 > root@10.0.0.2's password: You're running as root on the client side. Why? It's a bad idea. Are you in X11 on the client side as root? I have never, ever, done "startx" as root, not even once. On the rare occasions I might want to run a GUI app as root, I'd use sudo, su, and/or kdesu. (I don't use GUI apps as root, as a general rule. System administration tasks can be done in mc and at the command prompt. If you're not in X as root, it could be as Maxim posted: xauth failure. root is trying to use the authentication in /root, not the one in your $HOME. > root@lizard:~# kdetv You need to be root to watch TV? Perhaps you should adjust some permissions. You're taking the name of root in vain, and this shall return someday to haunt you. You should learn NOW to understand how Unix permissions work. -- /dev/rob0 - preferred_email=i$((28*28+28))@softhome.net or put "not-spam" or "/dev/rob0" in Subject header to reply |