Closed Bug 282139 Opened 20 years ago Closed 20 years ago

provide ssh-agent instructions in cvs-ssh-faq.html

Categories

(www.mozilla.org :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jwatt, Assigned: jwatt)

References

()

Details

Attachments

(2 files)

We should provide instructions on how to use ssh-agent in the cvs over ssh faq. 

I looked into how to use ssh-agent a few days ago, and found there are a lot of
docs on how to use it in a Unix-like environment. Since the people our
instructions would be aimed at would be those unfamiliar with ssh-agent, it
seems reasonable to assume that they won't already have an instance of it
running. In that case the simplest solution seemed to be that they run the
following two shell commands.

  eval `ssh-agent -s`
  ssh-add ~/.ssh/id_dsa

or:

  eval `ssh-agent -c`
  ssh-add ~/.ssh/id_dsa

followed later by:

  ssh-agent -k

I couldn't find any docs out there on how to do the same thing in the MS command
prompt, but the following three lines are what I've come up with after much
trial and error and discussion on alt.msdos.batch. (In the MS command prompt
it's necessary that the environment variable HOME is set to the absolute
*cygwin* path of your cygwin home directory, otherwise ssh-add won't work.)

  for /f "tokens=1,2,3* delims=; " %a in ('ssh-agent -c') do if "%a"=="setenv"
set %b=%c
  set HOME=/cygdrive/c/path/to/your/cygwin/home/directory
  ssh-add ~/.ssh/id_dsa

Of course when these commands are used in a batch file you need to replace all
occurances of "%" in the first line with "%%".

If there's agreement that this is an acceptable method to recommend, then I'll
write something up for that section of the webpage and attach a diff for review.
Huh.  That's a lot quicker than what I do.  I basically re-write the ssh-agent
output into a batch file and run that.

REM parse the unix output of ssh-agent to something dos recognizes
call ssh-agent.exe > %TEMP%\ssh-agent.out
sed -e "s/; export SSH_AUTH_SOCK;//" %TEMP%\ssh-agent.out > %TEMP%\ssh-agent_2.out
sed -e "s/SSH_AUTH_SOCK/SET SSH_AUTH_SOCK/" %TEMP%\ssh-agent_2.out >
%TEMP%\ssh-agent.out
sed -e "s/; export SSH_AGENT_PID;//" %TEMP%\ssh-agent.out > %TEMP%\ssh-agent_2.out
sed -e "s/SSH_AGENT_PID/SET SSH_AGENT_PID/" %TEMP%\ssh-agent_2.out >
%TEMP%\ssh-agent.out
sed -e "s/;//" %TEMP%\ssh-agent.out > %TEMP%\ssh-agent_2.out

REM now run the batch file
if exist %TEMP%\ssh-agent.bat call del %TEMP%\ssh-agent.bat
rename %TEMP%\ssh-agent_2.out ssh-agent.bat
call %TEMP%\ssh-agent.bat

REM clean up
del %TEMP%\ssh-agent.bat
del %TEMP%\ssh-agent.out
this refers some images and can see at http://moz.rsz.jp/wincvs/wincvs.html
I use M$ Windows 2000 Professional Japanese, so these images has JP language.
Sounds good, sorry for the delay in getting to it.

One thing, though: if you just run ssh-add with no args, it should pick up all
the keys it can find, rather than making us say what the filename of the key
should be.  If that still works for you, I think it's to be preferred, or
possibly mention both.

Please mark your diff for my review, and I'll try to get to it (more) promptly.
Attached patch draftSplinter Review
How about something along these lines? It can probably be improved quite a bit,
so the more comments and suggestions the better.
Mike: I forgot to say, if you omit the key's filename then ssh-add will look for
and add three files; $HOME/.ssh/id_rsa, $HOME/.ssh/id_dsa and
$HOME/.ssh/identity. If the user chose a different filename when they created
their key then it won't be picked up.
Status: NEW → ASSIGNED
Attachment #176010 - Flags: review?(shaver)
You might also mention that on Mac OS X, a handy app called SSHKeychain can set
up cvs for ssh automatically.
Comment on attachment 176010 [details] [diff] [review]
draft

>+  Essentially both sets of commands do the same thing. First ssh-agent is
>+  called and it's output is evaluated in the current environment. This sets
	       ^^^
its

I can't speak to the Win32 specifics, but the text looks fine.
Attachment #176010 - Flags: review?(shaver) → review+
Thanks shaver. Somehow I managed to miss your review. I made the spelling
correction and moved the second paragraph to put it after the instructions.

Checking in mozilla-org/html/cvs-ssh-faq.html;
/cvsroot/mozilla-org/html/cvs-ssh-faq.html,v  <--  cvs-ssh-faq.html
new revision: 1.8; previous revision: 1.7
done

(In reply to comment #6)
> You might also mention that on Mac OS X, a handy app called SSHKeychain can set
> up cvs for ssh automatically.

I don't know anything about Mac or SSHKeychain. If anyone else does, please open
a new bug.
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Product: mozilla.org → Websites
Component: www.mozilla.org → General
Product: Websites → www.mozilla.org
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: