0
votes

I am struggling to get our Ubuntu TeamCity server to checkout repos via SSH. Basically my question is, where would I specify the private-key password?

When running a shell on the machine hosting teamcity and being logged in as the user under which teamcity runs, I can run hg clone ssh://hg@localhost/test to clone repository "test". But I have to type the user's private key password.

My TeamCity project is setup as:

  • Pull Changes From: hg clone ssh://hg@localhost/test
  • Password: (password for private-key)

Clicking "Test connection" results in

Test connection failed in Test :: Test 42. '/usr/bin/hg identify ssh://hg@localhost/test' command failed.
stdout: remote: Permission denied, please try again.
remote: Permission denied, please try again.
remote: Permission denied (publickey,password).

stderr: abort: no suitable response from remote hg!
1

1 Answers

0
votes

If the key pair is only used for the TeamCity server's interaction with the Mercurial repository, the simplest and still secure solution, provided you protect the private key file with restrictive enough access permissions (i.e. read-only for the user which the TeamCity server runs as), is to remove the passphrase from the private key. A private key with an empty passphrase will no longer prompt for the passphrase and thus won't require user interaction, enabling an automation solution.