Quickstart Guide To Shell Services In SourceForge

0 comments suggest edit

Consider this a more advanced followup to my Quickstart Guide to Open Source Development With CVS and SourceForge.


So you have finally decided to become a flower power card carrying community loving member of an an open source project that happens to be hosted on Sourceforge. Good for you! Unfortunately, someone might expect you to actually contribute something. Suppose they give you the responsibility to update the project Home Page. SourceForge provides the ability to host project home pages within SourceForge itself, but how do you access those files? This guide will help you with that so you can earn the respect of your peers and graduate from n00b to contributor.

First, it is important to understand that you will not be able to fallback on your trusty FTP client to move your files to your SourceForge website. If you are a Windows developer unnaccustomed to the *nix-y ways of doing things (*nix == unix, linux, anyothernix…), it’s time to get the hands a bit dirty. But don’t you worry, I’ll present the most Windowsy manner to get *nixy tasks done.

To access files on SourceForge, you are going to have connect to their shell services via an SSH session. SSH is a protocol which is analogous to, but different from FTP. Some applications adopt this protocol to provide secure communication between servers, such as SFTP (secure FTP) and SCP (secure copy). Applications which are not built on SSH can still use these services by communicating through an SSH tunnel.

WinSCP To Securely Transfer Files

The quick and easy way to do this for those of us who don’t work with *nix every day is to download and install WinSCP. WinSCP is both a SFTP (SSH File Transfer Protocol) and SCP (Secure Copy Protocol) client.

SourceForge Project Shell Info

Before you start with WinSCP, you’ll need some information about your SourceForge project handy. Remember, as with all things *nix, everything is case sensitive.

  • Hostname: shell.sourceforge.net (or shell.sf.net)
  • Username: as used to login to the SourceForge.net web site.
  • Password: Password authentication is not supported. You must configure a SSH key pair for authentication.
  • Project Group Directory: /home/groups/P/PR/PROJECTNAME
  • Project Web Directory (root): /home/groups/P/PR/PROJECTNAME/htdocs
  • Project Web CGI Script Directory: /home/groups/P/PR/PROJECTNAME/cgi-bin

For example, these values for me on Subtext are…

  • Hostname: shell.sourceforge.net (or shell.sf.net)
  • Username: haacked
  • Password: leave blank
  • Project Group Directory: /home/groups/s/su/subtext
  • Project Web Directory (root): /home/groups/s/su/subtext/htdocs
  • Project Web CGI Script Directory: /home/groups/s/su/subtext/cgi-bin

Using WinSCP

When WinSCP first starts, you will see a dialog box that requests various host information. Enter the following details in to the provided dialog box:

  • Host name: shell.sourceforge.net (or cf-shell.sourceforge.net)
  • Port number: 22
  • User name: YOUR_USERNAME
  • Password: leave this field blank
  • Private key file: Click on the “…” button to browse for the PuTTY private key you created previously following the instructions here. Load the desired key.
  • Protocol: SFTP (allow SCP fallback)

Below is a screenshot of this dialog and how I entered the fields.

Click Save and choose the default for the session name which should matche the hostname you entered previously (USERNAME@shell.sourceforge.net or USERNAME@cf-shell.sourceforge.net).

To start the session, click the Login button. The first time you do this for a session, you will get a dialog asking to compare the SSH host key fingerprint. This is to make sure you are connecting to the site you think you are connecting to.

If you followed the instructions as I described, you should see the following key:


If yours differs, compare it against the list of keys here. If it does not match, please contact SourceForge.net staff by submitting a Support Request.

Once you are logged in, you can browse your project directories. Browse to your project root and if you choose the Explorer view as I did, it should look like the screenshot below.

WinSCP ScreenShot

Place your web files within the hcp directory. Unfortunately at the time of this writing, SourceForge won’t run .NET code, but it does support cgi as well as PHP and MySQL.


Found a typo or error? Suggest an edit! If accepted, your contribution is listed automatically here.



10 responses

  1. Avatar for Jeff Atwood
    Jeff Atwood January 15th, 2006

    I have a more general question.

    Why is all this pain in the ass stuff necessary? Is sourceforge really THAT important?

    Is there another way to work on code collaboratively that doesn't require us to jump through 24 concentric hoops of fire while simultaneously whistling dixie and drinking from a cup of water without spilling any of it?

  2. Avatar for Haacked
    Haacked January 15th, 2006

    Well for a *nix user, this wouldn't really be considered jumping through hoops. There's a different way of doing things when working with remote servers in *nix.

    And it's more secure.

    Think of it this way, when I use WebHost4Life to host, I use FTP to transfer files. Hardly a secure means of moving files since passwords in FTP are sent in clear text.

    Honestly, I prefer this *nix SourceForge approach. By uploading my public key, my one encryption private key allows me to access CVS, Shell Services, etc at SourceForge. I don't have to enter my password all the time. Just once for the key when I load up Pageant.

  3. Avatar for Jeff Atwood
    Jeff Atwood January 15th, 2006

    There has to be a better way. I'm tired of blindly aping what Java and UNIX do.

    Not that I *have* a better way, mind you, so take those comments with a grain of salt..

  4. Avatar for Haacked
    Haacked January 16th, 2006

    Well there are better ways, they're just more costly.

    For example, in the Windows world, you could use Virtual Server and give everyone VPN access to their own virtual server. But the expense of that approach would preclude it from being a FREE service.

    A better way to do what exactly?

  5. Avatar for Jeff Atwood
    Jeff Atwood January 16th, 2006

    A better way to work on code collaboratively.

    Or, perhaps SourceForge is the evolutionary endpoint of thousands of years of intense thought on how best to develop software.

    I'm thinking... not so much.

    Like I said, I get tired of the .NET community blindly aping what UNIX and Java do, just because we're too lazy to make something better or at the very least improve on what they did.

    Just take a Java project and change that "J" to an "N", baby! That's progress!!

    Anyway, end of rant, I am interested in easier, simpler, faster ways to accomplish what sourceforge does. Maybe that doesn't exist now. That's OK too.

  6. Avatar for Haacked
    Haacked January 16th, 2006

    Well it sure ain't GotDotNet. I think SourceForge does a fine job for a FREE hosted CVS platform. You don't have to host your website files there (but if you wanted to, I showed you how).

    However, if you can spend money on your own source control hosting, you might consider using trac (http://www.edgewall.com/trac/) and subversion.

  7. Avatar for Niels Hansen
    Niels Hansen January 16th, 2006

    Having now done work on both sides of the fence, I really do see the value that the *nix community brings when it comes to working collaboratively .

    When I first started using the Unix side of my OS X I hated it because it was not like Windows and I felt like they were so far behind. However, the more and more I started playing around with it I've to realize that Windows had created a very lazy community with security as a complete after thought. I decided to change the way we did things at our company and started implenting more of the Unix way.

    I rarely use FTP now but instead use SSH for all my file transfers. We've gone 100% to CVS and stopped using VSS. Bugilla over hmmm....Excel.

  8. Avatar for Haacked
    Haacked January 16th, 2006

    CSS? Ugh! Subversion is where it's at! ;)

  9. Avatar for Andy
    Andy May 30th, 2006

    And what if the dialog asking to compare the SSH host key fingerprint does not appear? It states "Server unexpectedly closed network connection." Firewall says that it allows everything. Disabling doesn't change anything. Command like "telnet shell.sourceforge.net 22" does not work. How do I know when it's my fault?

  10. Avatar for Sam
    Sam January 13th, 2009

    These instructions are now out of date- SF has released a new system whereby a key is no longer required and you can SFTP to web.sourceforge.net using the username: USERNAME,PROJECTNAME.