Discussion:
You should be using SSH ControlMaster. Was: SSH Tunnel and Agent Question
(too old to reply)
Richard Bronosky
2009-09-21 03:37:48 UTC
Permalink
I learned about this is one year ago at Atlanta Linux Fest 2008.
Because I LIVE in ssh, it has saved me several hours of productivity.

http://www.google.com/search?q=ssh+controlmaster

The only problem I found was with using subversion with svn+ssh://
urls. That required me to export this evn var:
SVN_SSH='ssh -o ControlMaster=no'

.!# RichardBronosky #!.
I was curious if I could do the same things with an ssh tunnel. I set
one up with
ssh -fNA -o ProxyCommand='ssh host_2 nc %h %p' -L 2222:host_4:22 host_3
I know the tunnel works, because I can do
ssh -vp 2222 localhost
and I'll be logged in to host_4. The end of the ssh debug messages say
debug1: Next authentication method: publickey
debug1: Server accepts key: *snip*
debug1: Authentication succeeded (publickey).
However, when I try to use rsync over the tunnel
rsync -e "ssh -vp 2222" localhost:/remote/files/ /local/files
So it turned out my problem was that, in the non-sanitized example, I
had forgotten to specify a username where I needed to. Once I did that,
it worked just like it should.
--
All the best,
Brian Pitts
_______________________________________________
Ale mailing list
Ale at ale.org
http://mail.ale.org/mailman/listinfo/ale
Michael B. Trausch
2009-09-21 04:00:42 UTC
Permalink
Post by Richard Bronosky
I learned about this is one year ago at Atlanta Linux Fest 2008.
Because I LIVE in ssh, it has saved me several hours of productivity.
That is nifty. I am totally using that from now on.

--- Mike
--
Blog: http://mike.trausch.us/blog/
Misc. Software: http://mike.trausch.us/software/

?The greater danger for most of us lies not in setting our aim too
high and falling short; but in setting our aim too low, and achieving
our mark.? ?Michelangelo
Brian Pitts
2009-09-21 04:28:00 UTC
Permalink
Post by Michael B. Trausch
Post by Richard Bronosky
I learned about this is one year ago at Atlanta Linux Fest 2008.
Because I LIVE in ssh, it has saved me several hours of productivity.
That is nifty. I am totally using that from now on.
ControlMaster is nifty, and I set it to auto for hosts that I'm making a
lot of connections to or through. However, I occasionally run into
quirks. E.G even if X forwarding is configured for a host in your ssh
config, sshfs doesn't enable it. If you have ControlMaster enabled and
connect to a host using sshfs first, when you later connect to it
through ssh X forwarding won't work. Another quirk I've seen with
ControlMaster is when you have a host_b that you connect to via a
ProxyCommand involving host_a. If you open a terminal, ssh into host_a,
open another terminal, ssh into host_b, then switch back to the original
terminal and try to disconnect from host_a it will hang until you also
disconnect from host_b.

So use it, but don't forgot that you set it up or else you'll
occasionally be puzzled.
--
All the best,
Brian Pitts
Michael B. Trausch
2009-09-21 04:33:22 UTC
Permalink
Post by Richard Bronosky
Post by Michael B. Trausch
Post by Richard Bronosky
I learned about this is one year ago at Atlanta Linux Fest 2008.
Because I LIVE in ssh, it has saved me several hours of
productivity.
Post by Michael B. Trausch
That is nifty. I am totally using that from now on.
ControlMaster is nifty, and I set it to auto for hosts that I'm making a
lot of connections to or through. However, I occasionally run into
quirks. E.G even if X forwarding is configured for a host in your ssh
config, sshfs doesn't enable it. If you have ControlMaster enabled and
connect to a host using sshfs first, when you later connect to it
through ssh X forwarding won't work. Another quirk I've seen with
ControlMaster is when you have a host_b that you connect to via a
ProxyCommand involving host_a. If you open a terminal, ssh into host_a,
open another terminal, ssh into host_b, then switch back to the original
terminal and try to disconnect from host_a it will hang until you also
disconnect from host_b.
So use it, but don't forgot that you set it up or else you'll
occasionally be puzzled.
Yeah, I'm used to the apparent hangs when I have an X application that I
run remotely, and exit the shell and find that I forgot to also close
the X application. I don't ever assume it's actually hung anymore, I
assume I did something stupid that caused the underlying connection to
remain open. :)

--- Mike
--
Blog: http://mike.trausch.us/blog/
Misc. Software: http://mike.trausch.us/software/

?The greater danger for most of us lies not in setting our aim too
high and falling short; but in setting our aim too low, and achieving
our mark.? ?Michelangelo
Paul Cartwright
2009-09-21 09:30:47 UTC
Permalink
Post by Michael B. Trausch
Yeah, I'm used to the apparent hangs when I have an X application that I
run remotely, and exit the shell and find that I forgot to also close
the X application. ?I don't ever assume it's actually hung anymore, I
assume I did something stupid that caused the underlying connection to
remain open. ?:)
what's the difference between doing it this way & remote desktop?
to be honest, I've never been able to do remote desktop, but I'd LIKE to (
vacation coming up).

from far away, what is the best way to get into my box to run X apps, like
kontact??
--
Paul Cartwright
Registered Linux user # 367800
Registered Ubuntu User #12459
Matt Rideout
2009-09-21 09:56:16 UTC
Permalink
Post by Paul Cartwright
Post by Michael B. Trausch
Yeah, I'm used to the apparent hangs when I have an X application that I
run remotely, and exit the shell and find that I forgot to also close
the X application. I don't ever assume it's actually hung anymore, I
assume I did something stupid that caused the underlying connection to
remain open. :)
what's the difference between doing it this way & remote desktop?
to be honest, I've never been able to do remote desktop, but I'd LIKE to (
vacation coming up).
from far away, what is the best way to get into my box to run X apps, like
kontact??
If you want full desktop sharing, try an NX client and server. Those
generally run a lot more smoothly than VNC. If you just want to be able
to run individual X apps remotely:

1. Make sure you have a running X instance on your local system (X11
under OS X, xming under Windows)
2. Make sure that the SSH server's /etc/ssh/sshd_config allows for X11
sessions. There should be an "X11Forwarding yes" line
3. Connect to the remote system with X11 forwarding enabled on the
client side via -X, ie "ssh -X me at servername"
4. Start up the apps that you want to run from the command line, ie
"xterm &"
Brian Pitts
2009-09-21 14:41:34 UTC
Permalink
Post by Matt Rideout
If you want full desktop sharing, try an NX client and server. Those
generally run a lot more smoothly than VNC. If you just want to be able
Something I haven't tried, but that looks interesting, is
http://partiwm.org/wiki/xpra

"Xpra gives you "persistent remote applications" for X. That is, unlike
normal X applications, applications run with xpra are "persistent" --
you can run them remotely, and they don't die if your connection does.
You can detach them, and reattach them later -- even from another
computer -- with no loss of state. And unlike VNC or RDP, xpra is for
remote applications, not remote desktops -- individual applications show
up as individual windows on your screen, managed by your window manager.
They're not trapped in a box. "
--
All the best,
Brian Pitts
Paul Cartwright
2009-09-21 23:23:24 UTC
Permalink
Post by Matt Rideout
If you want full desktop sharing, try an NX client and server. Those
generally run a lot more smoothly than VNC. If you just want to be able
nomachine server/client.. looking/downloading now.
I'll check it out!
Post by Matt Rideout
1. Make sure you have a running X instance on your local system (X11
under OS X, xming under Windows)
2. Make sure that the SSH server's /etc/ssh/sshd_config allows for X11
sessions. There should be an "X11Forwarding yes" line
3. Connect to the remote system with X11 forwarding enabled on the
client side via -X, ie "ssh -X me at servername"
4. Start up the apps that you want to run from the command line, ie
"xterm &"
already had the X11Forwarding yes. I do use ssh almost daily.. mostly from my
windows laptop to my desktop, using key/login.


thanks!
--
Paul Cartwright
Registered Linux user # 367800
Registered Ubuntu User #12459
Matt Rideout
2009-09-21 09:56:43 UTC
Permalink
Post by Brian Pitts
Another quirk I've seen with
ControlMaster is when you have a host_b that you connect to via a
ProxyCommand involving host_a. If you open a terminal, ssh into host_a,
open another terminal, ssh into host_b, then switch back to the original
terminal and try to disconnect from host_a it will hang until you also
disconnect from host_b.
So use it, but don't forgot that you set it up or else you'll
occasionally be puzzled.
I see the same behavior with vanilla port forwarding, and am glad that
behavior exists. It's stopped me from disconnecting myself from some
service that I was still using on many occasions.
Loading...