l i n u x - u s e r s - g r o u p - o f - d a v i s
L U G O D
 
Next Meeting:
October 7: Social gathering
Next Installfest:
TBD
Latest News:
Aug. 18: Discounts to "Velocity" in NY; come to tonight's "Photography" talk
Page last updated:
2004 May 25 11:20

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] ssh with X11 remote
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] ssh with X11 remote



Dang, I have lots 's of typos...

Another thing too.. If you find you do not remember the DISPLAY
information on the target machine, and it is running Linux, you can
utilized a nifty "/proc technique" to assist you. (Let's assume it is PID
6667.) Then you can find the env vars of that shell as started with this:

$ grep "DISPLAY" /proc/6667/environ | strip | less

BTW, if you have not inspected the various data in the proc space, and
consider yourself a good sysadmin, shame on you! You have a lot of good
stuff in there. For example, you can actually copy an execuatable from
memory in this fashion with data in proc...

Say you started a program which is running in the background and
accidentally deleted the binary file that was executed and is still in
memory... locate the PID of the proccess (assume it is 8080 in this case)
and then you can do this:

$ cat /proc/8080/exe > /tmp/original-file

Try this:
$ cp /bin/bash /tmp/duh
$ /tmp/duh
$ rm /tmp/duh
$ ps -auxw | grep -i duh  | grep -v grep
(Select PID for your "duh" process, assume it is 8080 here)
$ rm /tmp/duh
$ cat /proc/8080/exe > /tmp/saved
$ exit
$ cmp /tmp/saved /bin/bash
(no differences)
$ echo $?
0
And the Exit status of cmp was zero, so it exited without error

:-)

HTH,
-ME


ME said:
> If you are actually running (logged into and using) an X11 session on a
> machine
> with an IP address avaulable to the actual host (or local) and you specify
> on that host (with the xhost command) what hosts may connect, then yo u
> can log into
> a machine and alter your DISPLAY env var from the one created by ssh in
> its session for X11 forwarding to be the IP address : X Session.SessiondID
> of that host.
> For example. I ssh to 192.168.0.1 from 10.0.0.1.
>
> After I log in, i do this:
> $ echo $DISPLAY
> and I see:
> localhost:10.0
>
> If I have previously logged into a sesison on the target machine (could be
> itself or another machine on the network) and set xhost to allow X11
> display from the 192.168.0.1 host, then you can take the DISPLAY env var
> from that target machine and alter the DISPLAY env var within your ssh
> session to match that:
> (Assuming bash, and sample SessionID/#)
> $ export DISPLAY="targetmachineIP:0.0"
>
> Now, when you start X apps from that ssh session, the graphics will all be
> redireted to that DISPLAY instead of your local one.
>
> (This was a method that was used to sometimes play pranks on people using
> shared systems... Before web-popups, there were xeyes, xclock, and funky
> screen mod popups where buddies would harass each other by altering each
> other's X session contents)
>
> HTH,
> -ME
>
>
> Jonathan Stickel said:
>> I have an interesting problem with ssh and X11.  I know how to use ssh
>> with X11 forwarding to my local machine.  However, I have a program that
>> generates a series of image files, and it insists on connecting to an X
>> server to do so.  Running this via ssh means that ALL the data involved
>> gets forwarded to my local machine and then back again; this is very
>> inefficient.
>>
>> Is there any way to run ssh and tell it to use its own X server?
>
> _______________________________________________
> vox-tech mailing list
> vox-tech@lists.lugod.org
> http://lists.lugod.org/mailman/listinfo/vox-tech
>
>

_______________________________________________
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech



LinkedIn
LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
facebook
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
O'Reilly and Associates
For numerous book donations.