diff options
author | Joey Hess <joey@kitenet.net> | 2013-07-31 13:30:49 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-07-31 13:30:49 -0400 |
commit | 595633e7bb6fe5b3c92fe09ab4489156896b7c21 (patch) | |
tree | a4567dcaeeeda6634e1b2b2d692fec38d5079215 /Assistant/Ssh.hs | |
parent | de6872b36985a825eb9fb3b818468ff2bce7a7cb (diff) |
set IdentitiesOnly
When setting up a dedicated ssh key to access the annex on a host,
set IdentitiesOnly to prevent the ssh-agent from forcing use of a different
ssh key.
That behavior could result in unncessary password prompts. I remember
getting a message or two from people who got deluged with password
prompts and I couldn't at the time see why.
Also, it would prevent git-annex-shell from being run on the remote host,
when git-annex was installed there by unpacking the standalone tarball,
since the authorized_keys line for the dedicated ssh key, which sets
up calling git-annex-shell when it's not in path, wouldn't be used.
This fixes
http://git-annex.branchable.com/bugs/Internal_Server_Error:_Unknown_UUID
but I've not closed that bug yet since I should still:
1. Investigate why the ssh remote got set up despite being so broken.
2. Make the webapp not handle the NoUUID state in such an ugly way.
3. Possibly add code to fix up systems that encountered the problem.
Although since it requires changes to .ssh/config this may be one for
the release notes.
Thanks to TJ for pointing me in the right direction to understand what
was happening here.
Diffstat (limited to 'Assistant/Ssh.hs')
-rw-r--r-- | Assistant/Ssh.hs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Assistant/Ssh.hs b/Assistant/Ssh.hs index 10a4c7838..7a93a2fa9 100644 --- a/Assistant/Ssh.hs +++ b/Assistant/Ssh.hs @@ -172,6 +172,9 @@ genSshKeyPair = withTmpDir "git-annex-keygen" $ \dir -> do - ~/.ssh/ANYTHING.pub, and uses them indiscriminately. But using this key - for a normal login to the server will force git-annex-shell to run, - and locks the user out. Luckily, it does not recurse into subdirectories. + - + - Similarly, IdentitiesOnly is set in the ssh config to prevent the + - ssh-agent from forcing use of a different key. -} setupSshKeyPair :: SshKeyPair -> SshData -> IO SshData setupSshKeyPair sshkeypair sshdata = do @@ -188,7 +191,9 @@ setupSshKeyPair sshkeypair sshdata = do writeFile (sshdir </> sshpubkeyfile) (sshPubKey sshkeypair) setSshConfig sshdata - [ ("IdentityFile", "~/.ssh/" ++ sshprivkeyfile) ] + [ ("IdentityFile", "~/.ssh/" ++ sshprivkeyfile) + , ("IdentitiesOnly", "yes") + ] where sshprivkeyfile = "git-annex" </> "key." ++ mangleSshHostName sshdata sshpubkeyfile = sshprivkeyfile ++ ".pub" |