Powered by Invision Power Board


  Reply to this topicStart new topicStart Poll

> X-Forwarding thru SSH
fishsponge
Posted: Apr 9 2003, 10:42 AM
Quote Post


Administrator
********

Group: Admin
Posts: 679
Member No.: 1
Joined: 13-February 03



To export your display securely, or even across the internet, do the following:

1. Edit your SSHD config file on the remote machine (try "/etc/ssh/sshd_config") and change the "X11Forwarding" line to say:
CODE
X11Forwarding yes

2. Restart the SSH Daemon on the remote machine, being careful not to break your connection in the process!
3. On the local machine (localhost) type "xhost +" to allow an X connection from any host.
4. SSH into the remote machine, and start a program that requires an X display! it should appear!! :D

If it does not appear, try and use "ssh -v" instead, to enable verbose mode, to see any error messages that are occuring. If everything works as it should, you should see the X connection being opened:
CODE
bash-2.03$ ssh -v turnip
SSH Version 1.2.27+1.2.31-NSG [sparc-sun-solaris2.5.1], protocol version 1.5.
Standard version.  Does not use RSAREF.
emonster: Reading configuration data /usr/dist/share/SENSsshc,v1.2.2/etc/ssh_config
emonster: ssh_connect: getuid 140676 geteuid 140676 anon 1
emonster: Connecting to turnip [192.168.254.101] port 22.
emonster: Connection established.
emonster: Remote protocol version 1.99, remote software version OpenSSH_3.4p1 Debian 1:3.4p1-1
emonster: Waiting for server public key.
emonster: Received server public key (768 bits) and host key (1024 bits).
emonster: Host 'turnip' is known and matches the host key.
emonster: Initializing random; seed file /home/hobbs/.ssh/random_seed
emonster: Encryption type: 3des
emonster: Sent encrypted session key.
emonster: Installing crc compensation attack detector.
emonster: Received encrypted confirmation.
emonster: No agent.
emonster: Doing password authentication.
hobbs@turnip's password:
emonster: Requesting pty.
emonster: Requesting X11 forwarding with authentication spoofing.
emonster: Requesting shell.
emonster: Entering interactive session.
Linux turnip 2.4.18-bf2.4 #1 Son Apr 14 09:53:28 CEST 2002 i686 unknown
You have new mail.
Last login: Wed Apr  9 11:05:22 2003 from emonster
hobbs@turnip:~$ logout
Connection to turnip closed.
emonster: Transferred: stdin 1, stdout 1181, stderr 48 bytes in 2.6 seconds
emonster: Bytes per second: stdin 0.4, stdout 457.7, stderr 18.6
emonster: Exit status 0
bash-2.03$
The line that indicates the X session beginning is here:
CODE
emonster: Requesting X11 forwarding with authentication spoofing.
PMEmail PosterUsers WebsiteICQAOLYahooMSN
Top
foobar
Posted: Sep 23 2004, 03:06 AM
Quote Post


User Level: 2
**

Group: Members
Posts: 15
Member No.: 505
Joined: 6-September 04



nonononono! Please don't do this unless you want to have your keystrokes logged by Bad Guys ™. The ssh/sshd will automagically set up the MIT magic cookies, so there's no need to disable access control on your local X server. X applications will tunnel just fine thru the encrypted tunnel, so long as both client and server have X forwarding enabled.

>On the local machine (localhost) type "xhost +" to allow an X connection from any >host.
PMEmail Poster
Top
fishsponge
Posted: Sep 23 2004, 02:04 PM
Quote Post


Administrator
********

Group: Admin
Posts: 679
Member No.: 1
Joined: 13-February 03



ok, "xhost +" is a bad command, but you cannot deny that the above solution does work. (Also, "xhost +" was the best i could do with my knowledge at the time :D)

a better command to use instead of "xhost +" would be what exactly??
PMEmail PosterUsers WebsiteICQAOLYahooMSN
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
« Next Oldest | Tutorials & How-To's | Next Newest »

Topic Options Reply to this topicStart new topicStart Poll

 



[ Script Execution time: 0.0466 ]   [ 12 queries used ]   [ GZIP Enabled ]




Partners: Cambridge Plus :: <Link Available> :: Electronic Circuit Design :: <Link Available>
Unix Man Pages / Linux Man Pages :: HiFi Forum :: SIP VoIP Phone & Provider Reviews :: UNIX/Linux Forum Archives

More info on advertising on Unix/Linux Forum