Fix Invalid Port Number Error with TortoiseSVN and PuTTY

I just wasted an hour on this, so I hope that explaining the solution here will help someone. If you’re using TortoiseSVN and PuTTY, perhaps using a private key created with PuTTYgen (like me), then this probably applies to you. I’m using Windows XP Pro, but Home is probably the same. I didn’t have this problem before because I just used cygwin’s ssh.exe which worked fine.

PuTTY Internal Error
Invalid Port Number
For TortoiseSVN’s SSH cilent, leave the box blank. Do not choose putty.exe, that doesn’t work. Blank is fine, TortoisePlink is fine. Otherwise you see the error above. When you enter the URL to the repository, use the PuTTY saved session name instead of the server name. For example, if your session is MyConnection, use MyConnection for the server instead of, for example, svn.osafoundation.org.

77 Responses to “Fix Invalid Port Number Error with TortoiseSVN and PuTTY”

  1. ThunderHammer says:

    Thank you so much….great advise ;)

  2. Miguel Ángel says:

    Thanks for this post! It helps me a lot with the SVN and SSH :)

  3. Leif says:

    Thanks for this blog post. only place I figured out the issues I encountered. Should be stated in the manual.

  4. TheCrazyITGuy says:

    This needs to be published for sure. I screwed around with it for an hour, then googled it…found your post, and thanks!

  5. Ray says:

    Thanks Elliot! That is very helpful!

  6. Rodrigo says:

    Thank you, very much!
    I spent a lot of time trying to use TotoiseSVN with ssh on a port other than 22.
    And now I found this page.
    It helps me so much!!!

  7. stefan says:

    thank you sooooo much! i already drove crazy!!
    thx
    cheers stefan

  8. […] Fix Invalid Port Number Error with TortoiseSVN and PuTTY at Elliot Lee […]

  9. d9 says:

    hey, thought I’d share what worked for me – thank you for getting me on the right track.

    in TortoiseSVN>Settings>Network, make sure that “TortoisePlink.exe” is in the SSH field. Even leaving it empty didn’t work for me.

    on checkout, here was my string:
    svn+ssh://[email protected]/path/to/repo

    I had also saved a session in Putty called “myserver.com” with my username information.

    This was the result of a bunch of trial and error! Hope it works for you.

  10. phrakture says:

    Oh god, thank you. I completely forgot I set putty in the options!

  11. Vegard says:

    Thanks, really helped me out!

  12. nordicdyno says:

    Very useful for me!
    Respect from Russia! =)

  13. Mark says:

    Thanks for saving me hours…

  14. eero says:

    Thank you. It worked before, but now I’m having trouble again with version 1.4.1. This tame it says first “unable to write to standard output (stderr) and after that “connection closend unexpetdly”. Can you help?

  15. george says:

    Elliot

    Your are a legend :) , this has saved me hours to figure out why my conn was not working with tortoise/putty.

    Cheers George

  16. Sunrunner20 says:

    Thanks for being the good soul to publish this information.

  17. beza1e1 says:

    Thanks from here as well :)

  18. Bailey says:

    You’re my hero!

  19. Matt Miller says:

    I’m going to add my thanks to the long list already here. If only I found your site hours ago… I was up and running with a minute of reading this page :)

    Aside — like your WP theme. Which reminds me that mine is in need of an overhaul…

  20. erwan says:

    Thanks a lot, this saved me !!!

  21. eorit says:

    Thanks. It was very helpfull for me!

  22. prax says:

    Oh man,

    You saved the day. This must definitely put in the manual…

    regards,
    prax

  23. Ric says:

    Great!! Thanks a lot!! :-)

Leave a Reply