Darren Mothersele

Software Developer

Warning: You are viewing old, legacy content. Kept for posterity. Information is out of date. Code samples probably don't work. My opinions have probably changed. Browse at your own risk.

Access Drupal CVS from behind a firewall using SSH tunnelling

Feb 24, 2010


Working behind a firewall and need to get an up-to-date dev version of a Drupal module from the Drupal CVS? I was just stuck with this problem, but here's how I solved it.

Luckily, port 22 was open for ssh connection, so I tunnel the CVS traffic (port 2401) via my own server. Simple two step process:

1. Create an SSH connection in the background to your own server using the following command. Replace example.com with your host name and username with your ssh login name.

ssh -f -L 2401:cvs.drupal.org:2401 username@example.com -N

After this command you will have localhost:2401 mapping to cvs.drupal.org:2401 but via your SSH tunnel.

2. Run the usual Drupal CVS command, but replace localhost as the server. For example, to check out the most recent version of the date module:

cvs -z6 -d:pserver:anonymous:[email protected]:/cvs/drupal-contrib \
checkout -d date-DRUPAL-6--2 -r DRUPAL-6--2 contributions/modules/date/

That's it!

Update: Another useful SSH command is to use its internal SOCKS proxy to securely tunnel traffic:

ssh -D 6666 [email protected]

Then set firefox to use SOCKS proxy with values "localhost" and port 6666