From murdoch at stats.uwo.ca  Sun Mar 28 15:32:16 2010
From: murdoch at stats.uwo.ca (Duncan Murdoch)
Date: Sun, 28 Mar 2010 09:32:16 -0400
Subject: [Rd] Setting up TortoiseSVN and PuTTY on Windows
 for	r-forge.r-project.org (Was: Re: Using SVN + SSH on windows)
In-Reply-To: <59d7961d1003280604r41390ad0u5dfe66a4ac39c7d6@mail.gmail.com>
References: <59d7961d1003280604r41390ad0u5dfe66a4ac39c7d6@mail.gmail.com>
Message-ID: <4BAF5A60.2030004@stats.uwo.ca>

On 28/03/2010 9:04 AM, Henrik Bengtsson wrote:
> Here are some notes/observations I've done on my setup that works for
> me. Hopefully it will be added to some r-forge documentation/wiki.
> 
> I use:
> 
> Windows Vista Business SP2 32bit
> TortoiseSVN 1.6.7 (Build 18415 - 32 Bit , 2010/01/22 17:55:06)
> PuTTY v0.60 (with Pageant v0.60)
> 
> I have a deprecated r-forge project ('r-oo') that I will use through
> out.  My r-forge username is 'henrikb'.  The URL root to this project
> is: svn+ssh://henrikb at svn.r-forge.r-project.org/svnroot/r-oo
> 
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> PART I: WITHOUT PAGEANT RUNNING
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> 
> I.A. CHECKING OUT
> 1. Create a directory somewhere, e.g. r-oo,R-forge/
> 2. Right click on r-oo,R-forge/, select 'SVN Checkout...'
> 3. In 'URL of repository', enter
> 'svn+ssh://henrikb at svn.r-forge.r-project.org/svnroot/r-oo'.
> 4. Click OK.  A 'Checkout - TortoiseSVN' window will open with a line
> saying "Command" and "Checkout from ...".
> 5. After a while, another dialog will open titled 'TortoisePlink' and
> 'henrikb at svn.r-forge.r-project.org password:' asking you to enter your
> r-forge password.
> 6. After entering the password and clicking OK, some bytes are
> downloaded, and then yet again a new 'TortoisePlink' dialog asks you
> to enter your r-forge password.
> 7. After entering the password (the 2nd time) and clicking OK, the
> actual files are downloaded; in the main ''Checkout - TortoiseSVN'
> window you will see several lines of "Added" followed by a "Completed"
> statement.  Click OK.
> 8. Look in your local r-oo,R-forge/ directory in Windows Explorer (not
> Internet Explorer); it should now be populated with directories and
> files, and (possibly hidden) .svn/ directories.  All directories,
> except the .svn/ ones, now have a small overlay icon showing a "green
> checkmark", which indicates that the local file is up to date with the
> file on the r-forge SVN repository.
> 
> 
> I.B. COMMITS
> 1. Edit r-oo,R-forge/README (which is one of the files that comes with
> all r-forge projects).  I just add one line "foo" at the top so there
> is a change.  Close the editor.
> 2. In Windows Explorer, the overlay icon now changed to a "red
> exclamation mark", indicating that the content of the file differ from
> the content available on the SVN repository.
> 3. To commit the changes to the online SVN repository, right click on
> the file, select 'SVN Commit...'
> 4. A window titled 'Commit - ...' opens.  You can enter a log message
> in the upper panel.  In the lower panel you see what files that will
> be committed.
> 5. After clicking OK to commit, the 'TortoisePlink' dialog pops up and
> asks you to enter your r-forge password.
> 6. After entering the password and clicking OK, then files will be
> sent.  In 'Commit - ...' window you will see several lines reporting
> this, e.g. "Command Commit", "Modified...", "Sending content ...", and
> "Completed ...".  Click OK.
> 7. The icon for r-oo,R-forge/README should now be a green checkmark
> (sometimes there is a delay in the update of the icon and you might
> have to navigate in and out of the directory for it to be updated;
> either way, the file online is updated.)
> 
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> PART II: ABOVE WITH PAGEANT RUNNING
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> Pageant (comes with PuTTY) is a Windows programming running in the
> background that when setup properly together with r-forge will do
> automatic authentication so that you do not have to enter your r-forge
> password for every SVN checkout/commit/update.
> 
> II.A. GENERATE A PAIR OF PUBLIC/PRIVATE KEYS FOR SSH
> 1. Start PuTTYgen.  A 'PuTTYgen Key Generator' window opens.
> 2. Click 'Generate'.
> 3. Follow the instructions, i.e. move the mouse over the panel to
> generate some randomness. When done, a key is generated.
> 5. Click "Save private key".   Do *not* enter a "key passphrase", that
> is, reply "Yes" to the dialog asking you "Are you sure want to save
> this key without a passphrase to protect it?".   Name the file, say,
> 'henrikb,20100328.ppk'.  Save it in a directory where you can find it
> (default for me is under the Documents/).

I do it with a passphrase, which requires a small change below.  The 
advantage of doing it with a passphrase is that if someone steals my 
laptop containing the key, they still won't be able to access anything 
unless they can guess my passphrase.  (I use the same key to access a 
number of things, including some that I am more concerned about 
protecting than my R-forge files.)

> 6. Before closing PuTTYgen, we want to add the displayed *public key*
> to the r-forge site.
> 7. Go to your 'My Page' -> 'Account Maintenance' at R-forge, i.e.
> http://r-forge.r-project.org/account/.
> 8. In the 'Shell Account Information' section at the bottom of the
> page, go to '[Edit Keys]'.
> 9. In the panel shown, paste the public key that you can copy from the
> PuTTYgen panel.  The key should look something like "ssh-rsa
> AAAAB3NzFOIEOROEPQPQxIDgvYxv5NZxYYjqnKUyYtPougE6R00ZLYKHZhtwyv61uLl/KkcprOBzhXIpFKn15efRr86H2psQYeDDpAB5EOc=
> rsa-key-20100328" in one line (without quotation marks).
> 10. Click 'Update' on the r-forge page.  In the 'Shell Account
> Information' section you should now see that the there is one more key
> at 'SSH Shared Authorized Keys'.
> 11. Close PuTTYgen and the r-forge page.
> 
> II.B. ADD THE PRIVATE KEY TO THE PAGEANT CLIENT
> 1. Start Pageant.  It will open as a small icon in the Windows System Tray.

I do this as part of each Windows logon, by putting the command

"...\pageant.exe" ...\foo.ppk

as a shortcut in my Startup folder.  (The ...'s are replaced with real 
paths, of course.)

This pops up a dialog where I need to enter the passphrase.  I get this 
every time I sign on to Windows which is a little irritating, but since 
I use svn+ssh for so many things, I probably make use of the key during 
almost every session.  I've become used to typing a Windows password to 
log on to Windows, then a Pageant passphrase to get access to various 
remote things.

Duncan Murdoch

> 2. Double click on the Pageant tray icon to open the 'Pageant Key List' window.
> 3. Click 'Add Key'.  Locate the *ppk file saved by PuTTYgen, e.g.
> 'henrikb,20100328.ppk'.  Open it.
> 4. In the 'Pageant Key List' window, the key should now be listed,
> e.g. "ssh-rsa  1024  ... rsa-key-20100328".  Note that the last part
> "rsa-key-20100328" is just a comment, but it should match the "Key
> comment" you saw in PuTTYgen and also at the end of the line pasted
> into r-forge, cf. Step II.A.9 above.
> 5. You can now "Close" the Pageant window.  Pageant will keep running
> in the System tray.
> 
> 
> II.C. COMMIT A CHANGE
> 1. Edit the r-oo,R-forge/README file again, e.g. add a line "bar".
> 2. Follow the Steps I.B. above to commit.  The difference is that you
> now do not have to enter the password.  Instead, Pageant will
> communicate with r-forge in the background who will use the public and
> private keys to exchange authentication information.
> 
> 
> NOTE:
> When I tried the above immediately after all the above steps, I was
> still asked for the password.  This was at 12:40 UTC.  However, when
> trying about 20 minutes later (13:01 UTC) the authentication works
> automatically (no password needed).
> 
> The reason for the delay is that r-forge needs several hours in order
> to update its authentication servers; this is written on the
> http://r-forge.r-project.org/account/editsshkeys.php page where you
> can read "This is done by a cron job, so it may not happen
> immediately. Please allow for a one hour delay."  (maybe it happens at
> every full hour - see above - but I don't know).  The exact time you
> have to wait is unknown, and I do not know of a way to check when the
> r-forge cron jobs have been run; there are no log files you check.
> There are some information about r-forge cron jobs at
> http://site.r-forge.r-project.org/, but they don't list the job for
> the above.
> 
> Hope this helps some one
> 
> Henrik
> 
> On Sun, Mar 28, 2010 at 5:45 AM, David Scott <d.scott at auckland.ac.nz> wrote:
>> Uwe Ligges wrote:
>>> It is really not hard to set it up. I am using a vanilla ssh (rather than
>>> putty) and that works fine all the time...
>>>
>>> Uwe Ligges
>>
>> Ditto here. I am using ssh non commercial version with tortoise on Vista,
>> and I don't recall any problems setting it up. R-forge works perfectly fine
>> with windows and tortoise in my experience.
>>
>> Is your putty/ssh working? Can you access other machines with it? I do
>> recall ssh can be a bit fussy.
>>
>> David Scott
>>
>>>
>>> On 27.03.2010 18:31, Gabor Grothendieck wrote:
>>>> s getting commits to R-Forge to work from
>>>> Windows.  The entire system is really geared to UNIX.  It took me a
>>>> couple of days of trial and error (since you have to wait 20 minutes
>>>> for each try) before I got it working.  Although I did get it to work,
>>>> I ultimately decided to host all my packages on googlecode.
>>>> googlecode is extremely easy to use from Windows and does not require
>>>> any public/private key, pageant, etc.  e.g.
>>>> http://sqldf.googlecode.com.  If you already have TortoiseSVN and know
>>>> how to use it then you can probably set up a googlecode site in
>>>> literally 5 minutes.
>>>>
>>>> One other possibility.  I think there is a way to host your project on
>>>> googlecode but still have it mirrored on R-forge so from your users'
>>>> viewpoint its the same as if it were on R-Forge but you can use the
>>>> simpler googlecode site.  In that case you might not need to set up
>>>> commits on R-Forge since you would do all your commits through
>>>> googlecode (depending on how it works) but I have not seen good
>>>> documentation on how to do this.
>>>>
>>> ______________________________________________
>>> R-devel at r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>
>> --
>> _________________________________________________________________
>> David Scott     Department of Statistics
>>                The University of Auckland, PB 92019
>>                Auckland 1142,    NEW ZEALAND
>> Phone: +64 9 923 5055, or +64 9 373 7599 ext 85055
>> Email:  d.scott at auckland.ac.nz,  Fax: +64 9 373 7018
>>
>> Director of Consulting, Department of Statistics
>>
>> ______________________________________________
>> R-devel at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



[Rd] Setting up TortoiseSVN and PuTTY on Windows for r-forge.r-project.org (Was: Re: Using SVN + SSH on windows)
Duncan Murdoch