Eric at Lucii.org on 29 Sep 2013 14:47:48 -0700


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] SSH Tunnel


Oh this is interesting!
I'm ultimately going to be chaining the scp command so I'll start with this.

Thanks
Eric

On 09/29/2013 03:02 PM, Mike Joseph wrote:
> One option that's slightly smoother is actually to use a ProxyCommand and chained ssh processes:
> 
> Host VM
>   Hostname 192.168.4.4
>   user USERNAMEforVM
>   ServerAliveInterval 300
>   ProxyCommand ssh oldsys nc %h %p
> 
> Host oldsys
>   Hostname 10.10.10.25
>   user eric
>   ServerAliveInterval 300
> 
> Although it's not as common as using port forwards for this, it allows you to tie the underlying ssh transport session directly to the active session so they are created and destroyed together.  Should also work with scp.
> 
> -MJ
> 
> 
> On Sun, Sep 29, 2013 at 11:50 AM, Eric at Lucii.org <eric@lucii.org <mailto:eric@lucii.org>> wrote:
> 
>     I need to create a ssh tunnel through an intermediate server (10.10.10.25)
>     to a vm on that server (192.168.4.4)
> 
>     So.... I put this in my .ssh/config file:
> 
>     Host oldsys
>       Hostname 10.10.10.25
>       user eric
>       ServerAliveInterval 300
>       LocalForward 20000 192.168.4.4:22 <http://192.168.4.4:22>
> 
>     I've set up the authorized_keys so the login at each stage should be automatic.
> 
>      = From the current machine I can ssh to 10.10.10.25
>      = From 10.10.10.25 I can ssh to 192.168.4.4
> 
>     But: the tunnel appears to not work.
>     When I 'ssh oldsys' from my original server I end up logged in to the 10.10.10.25 server.
>     It's like I never told it to do a forward :-(
> 
>     What am I missing here?
>     Eric
>     --
>     #  Eric Lucas
>     #
>     #                "Oh, I have slipped the surly bond of earth
>     #                 And danced the skies on laughter-silvered wings...
>     #                                        -- John Gillespie Magee Jr
>     ___________________________________________________________________________
>     Philadelphia Linux Users Group         --        http://www.phillylinux.org
>     Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
>     General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug
> 
> 
> 
> 
> ___________________________________________________________________________
> Philadelphia Linux Users Group         --        http://www.phillylinux.org
> Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
> General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug
> 

-- 
#  Eric Lucas
#
#                "Oh, I have slipped the surly bond of earth
#                 And danced the skies on laughter-silvered wings...
#                                        -- John Gillespie Magee Jr
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug