[ILUG] [Beginner] SSH Tunneling
Kevin Harry
eskimo1987 at yahoo.com
Fri Jul 20 15:11:51 IST 2012
Hi,
I realized I was missing one command to setup tunnel. Following thing worked, finally.
1) @local:ssh -L 2222:xeon:22 kevin at fenom (logs-in to fenom)
2) @fenom: ssh -L 50130:localhost:50130 kevin at xeon
3) @local: ssh -p 2222 kevin at localhost
4) @local: ssh -L 50130:localhost:50130 kevin at fenom
Now I am able to access hadoop interface on my local laptop. :)
Thanks CPH! I will give your solution a try, hope that further reduces the hassle.
Regards,
Kevin
________________________________
From: CP Hennessy <cp.hennessy at openapp.ie>
To: ilug at linux.ie
Sent: Friday, July 20, 2012 2:51 PM
Subject: Re: [ILUG] [Beginner] SSH Tunneling
Hi Kevin,
You can do a "ask me two passwords to login to a machine" thing.
eg. in your .ssh/config file add
Host fenom
Hostname fenom.whatever or IP address
User username-on-fenom
Port 222
ControlMaster auto
ControlPath ~/.ssh/ssh-%r@%h:%p
ControlPersist yes
LocalForward xeon-ip-address:50130 localhost:50130
Host xeon
Hostname IP address or name as known by fenom
User username-on-xeon
ProxyCommand ssh fenom nc %h 22
Now when you have the command :
$ ssh xeon
you shold be asked for the password for your fenom username, then the password
for your xeon user name. Obviously getting both of these right gives you a
shell prompt on xeon.
For bonus points I've also included the Control* stuff above which means that
while the first ssh is running, any subsequent ssh to xeon should only require
the xeon password and not the fenom one.
Note that I'm not 100% that the "LocalForward" line is listed for the right
host, so you may need to move it down to the "xeon" config.
CPH
On Fri 20 Jul 2012 and Kevin Harry wrote:
> Hello group,
>
> I'm new to this group and linux. I'm seeking help to setup SSH tunnel to my
> university's server. The server setup is described below:
>
> LOCAL: My local laptop at home - Window7 laptop with Cygwin installed. I
> have working bash shell. FENOM: This is the intranet server of my
> university which is accessible from any outside network/internet machine
> (e.g LOCAL). XEON: This is the main server or cluster where hadoop is
> installed. One can login to this server only via FENOM.
>
> Henceforth, using above names instead of IP address.
>
> Requirement:
> The Hadoop cluster interface is available
> at http://localhost:50130/jobtracker.jsp on XEON. I want this interface
> accessible on my LOCAL laptop with same URL.
>
> Solution:
> Create SSH tunnel to LOCAL->FENOM-> XEON.
>
> Steps taken so far:
> 1. created password less login from LOCAL to FENOM and FENOM to XEON. But I
> can't ssh directly to XEON from LOCAL with this. (this is correct I guess,
> unless tunnel is setup) 2. On LOCAL: executed ssh -L
> 2222:xeon:22 kevin at fenom [Successful]
>
> Problem:
> Now I think I have to execute this command on my LOCAL laptop:
> ssh -L 50130:localhost:50130 kevin at fenom [Failed]
>
> To be able to access hadoop interface
> (http://localhost:50130/jobtracker.jsp) on my LOCAL laptop. But this is not
> working.
>
> Please help me on how to fix this. I think I am doing something wrong,
> kindly point out my mistake to setup the SSH tunnel successfully.
>
> Thank you very much.
>
> Regards,
> Kevin--
> Irish Linux Users' Group mailing list
> About this list : http://mail.linux.ie/mailman/listinfo/ilug
> Who we are : http://www.linux.ie/
> Where we are : http://www.linux.ie/map/
--
Irish Linux Users' Group mailing list
About this list : http://mail.linux.ie/mailman/listinfo/ilug
Who we are : http://www.linux.ie/
Where we are : http://www.linux.ie/map/
More information about the ILUG
mailing list