The SSH Agent build feature, available since TeamCity 9.1, runs an SSH agent with the selected uploaded SSH key during a build. When your build script runs an SSH client, it uses the SSH agent with the loaded key.
Supported Key Format
TeamCity supports keys in the OpenSSH format only. If your private key uses a different format, it has to be converted to the OpenSSH.
For example, the Putty private key format (*.ppk) not supported by TeamCity can be converted to the OpenSSH format using PuTTY Key Generator: use the menu Conversions -> Export OpenSSH key.
TeamCity SSH Agent uses a native ssh agent from the OpenSSH included with Linux and Mac OS X, so the feature works out of the box for these OS's. For Windows, OpenSSH needs to be installed (e.g. as a part of CygWin, MinGW or a part of Git distribution for Windows).
The SSH agent must be added to $PATH on Unix-like OS's and to %PATH% on Windows.
For each TeamCity build agent a separate ssh agent is started,so it is possible to use this feature if several build agents are installed on the same machine.
Disabling SSH host key checking
The first time you connect to a remote host, the SSH client asks if you want to add a remote host's fingerprint to the known hosts database at
To avoid such prompts during a build, you need to configure the known hosts database beforehand. If you trust the hosts you are connecting to, you can disable known hosts checks:
either for all connections by adding something like this in
- or for an individual command by running an ssh client with the
-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=nooptions.