Connecting to a internal CVS repository from the office and home with no VPN

February 23, 2007

Have you ever had the need to access an internal CVS repository from the office and from home or any other place outside your organization’s intranet? This is something I have been doing for quite a while now as I work from home from time to time.

We don’t use any kind of VPN as we don’t have the necessary hardware to set it up properly but I have access to an internal machine from home through ssh that then allows me to connect to the CVS machine.

The tip is to create a SSH tunnel to connect to the CVS machine (I use ssh to access CVS). That way, your CVS repository is always accessed through a port opened in your localhost and so it looks the same to applications regardless of how you connect to the CVS repository.

Imagine the following scenario:

My laptop hostname is laptop.domain, the CVS server is cvs.domain and the machine I use to connect to the intranet from home is gateway.domain.

When I am at home I create the following tunnel (replace username with your login name in gateway.domain):
ssh -L2222:cvs.domain:22 username@gateway.domain

When I am in the office I create the following tunnel:
ssh -L2222:cvs.domain:22 laptop.domain

Note that you MUST NOT replace laptop.domain with localhost in the second ssh tunnel. If you do that, the SSH key associated to localhost will be your laptop’s one and this will prevent you from making a ssh connection to cvs.domain through the tunnel because the SSH host key that will be reported will be the cvs.domain’s one that will conflict with the the SSH key already registered (you laptop’s one) and therefore the client will refuse to open the connection.

To make things easier I have created two aliases that I add to my .bashrc or .alias or .bash_aliases depending on your GNU/Linux distribution:

alias cvs_home=’ssh -L2222:cvs.domain:22 username@gateway.domain’
alias cvs_office=’ssh -L2222:cvs.domain:22 laptop.domain’

When you configure the repository in your CVS client specify:

  • host: localhost
  • port: 2222
  • connection protocol: ext:ssh or ssh
Advertisements

5 Responses to “Connecting to a internal CVS repository from the office and home with no VPN”


  1. I read this post completely on the topic of the difference of hottest and earlier
    technologies, it’s amazing article.

  2. Deana Says:

    Write more, thats all I have to say. Literally,
    it seems as though you relied on the video to make your point.
    You definitely know what youre talking about, why waste your intelligence on just posting videos to your site when you could be giving
    us something informative to read?


  3. Heya i am for the first time here. I found this board and I find It truly useful & it helped me out a lot.
    I hope to give something back and help others like you helped me.


  4. With micro SD memory cards the memory can be expanded up to
    16 GB. Three anti Cellphone ‘ Waterproof, Dustproof, Anti-pressure. If two mobiles of different brand offer same type of features but in different prices then one should go with the mobile band with cheap price.


  5. It will just impostor twitter followers checker started out doing it in all probability about a month ago.
    So, hither we are in your compounding, whatever combination it is.
    The unscathed shortcode, got that on my beeper.
    Exchanging to the Texture card, I get that in return.
    That, you know, simply a bike, whatever, any of the stuff and nonsense
    can be 1.2million fans on the micro-blogging situation, where
    Sheen has induced the hashtags #tigerblood, #tigerblood and #victorious his own.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: