ssh via gateway to work host script
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Shell > ssh via gateway to work host script




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    ssh via gateway to work host script  
mike


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-24-07 06:16 PM

Hi,

I am writing a shell script to connect to my work computer.

If I use the following:

ssh   -l $USERID -Y  -L LOCAL_HOST_PORT:$WORK_HOST:22  $GATEWAY_HOST

I get the following prompt ( of course with real values but just as a
principle).

$USERID@$GATEWAY_HOST's password>

I generate a password and input it at the command line.

Then I have to type on the command line:

ssh    -Y  -L $WORK_HOST

Is it possible to get this in one script or how can avoid typing the
same information every time I login.

All ideas welcome!

cheers,

//mikael






[ Post a follow-up to this message ]



    Re: ssh via gateway to work host script  
Allistar


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-25-07 06:32 AM

mike wrote:

> Hi,
>
> I am writing a shell script to connect to my work computer.
>
> If I use the following:
>
> ssh   -l $USERID -Y  -L LOCAL_HOST_PORT:$WORK_HOST:22  $GATEWAY_HOST
>
> I get the following prompt ( of course with real values but just as a
> principle).
>
> $USERID@$GATEWAY_HOST's password>
>
> I generate a password and input it at the command line.
>
> Then I have to type on the command line:
>
> ssh    -Y  -L $WORK_HOST
>
> Is it possible to get this in one script or how can avoid typing the
> same information every time I login.
>
> All ideas welcome!
>
> cheers,
>
> //mikael

When I do this I have the port forward command like this:

ssh   -l $USERID  -L LOCAL_HOST_PORT:$WORK_HOST:22  $GATEWAY_HOST cat -

always running, then I do a

ssh  -p $LOCAL_HOST_PORT $WORK_HOST

It doesn't answer your question, but depending on how often you connect
through the tunnel you could just leave it always open.

There are other ways: use autossh to open a reverse ssh tunnel from
$WORK_HOST to localhost and then connect through that. Beware that some
network administrators may see this as circumventing their firewalls (which
it does).

Allistar.





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 02:17 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register