Find the answer to your Linux question:
Results 1 to 2 of 2
Hi guys, I hope you can help with a little problem I'm having. Just give you the background: 1) Let's call the two machines, Box A and Box B. 2) ...
  1. #1
    Just Joined!
    Join Date
    Jun 2010
    Posts
    1

    Unhappy Create SSH Tunnel before login (Presession?)

    Hi guys,

    I hope you can help with a little problem I'm having.

    Just give you the background:

    1) Let's call the two machines, Box A and Box B.
    2) OpenSSH is running on both machines.
    3) Key based authentication is setup between two users on these two machines, and both can login into the other with no problems at all.

    4) I'm also port tunnelling over SSH to encrypt some traffic between the two machines. (I did have the port tunnelling code here, but this forum won't let me post URL ).

    I can obviously then forward port 1000 on Box A to port 1000 on Box B, securely.

    However ... and this is my problem ... I want this port tunnelling connection to be automatic when I boot the machine, e.g. "Presession" and "before" a user logs in.

    I tried adding the tunnel command to gdm/PreSession/Default, but the problem then is because the user is not *logged in* at this stage, it can't use the user's private key to connect to the server, and hence can't automatically create the connection.

    How do I get Box A to automatically create a tunnel over a port to Box B, without any intervention from me, *prior* to any users logging in?

    Any help would be much appreciated!

    Kind regards,
    Gavin

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,975
    From the ssh man page:
    Code:
         -i identity_file
                 Selects a file from which the identity (private key) for RSA or DSA authen-
                 tication is read.  The default is ~/.ssh/identity for protocol version 1,
                 and ~/.ssh/id_rsa and ~/.ssh/id_dsa for protocol version 2.  Identity files
                 may also be specified on a per-host basis in the configuration file.  It is
                 possible to have multiple -i options (and multiple identities specified in
                 configuration files).
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...