Unix Technical Forum

ssh with X forwarding

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 ...


Go Back   Unix Technical Forum > Unix Operating Systems > Slackware Linux Support

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-19-2008, 10:52 AM
Matthew Robinson
 
Posts: n/a
Default ssh with X forwarding

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:~#

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-19-2008, 10:52 AM
Maxim Kovgan
 
Posts: n/a
Default Re: ssh with X forwarding

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.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-19-2008, 10:52 AM
Thomas Ronayne
 
Posts: n/a
Default Re: ssh with X forwarding

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:~#
>
>
>

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-19-2008, 10:52 AM
/dev/rob0
 
Posts: n/a
Default Re: ssh with X forwarding

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 07:31 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com