I want to use the same SSH key to access multiple Ubuntu servers. The reason for this is that I want to deploy our application in DEV, STAGING, PROD, LOCAL environments through a CI server. We use Ubuntu servers in these environments. The tech lead asked me to generate one key and use it for all the servers to make the continuous integration easy.
We useTeamcity for CI and the Teamcity server and its agents run in the same Windows server.
I have generated id_rsa and id_rsa.pub key pairs in one server (LOCAL server).
The next step is to copy id_rsa.pub to all the other servers and upload the id_rsa file to the Teamcity server.
I assume that since now the Teamcity server has the id_rsa key it should be able to ssh to Ubuntu servers and issue commands through SSH Exec (Deployer plugin).
Could someone tell me from the SSH key point of view what I have done and assumed so far is correct? The remote servers are Ubuntu and the client (Teamcity server) is a Windows server.
As I have described above I tried to connect to the server where I generated the keys from the city server. I this case, I uploaded the id_rsa to the teamcity server and tried to connect. I have given the following as the path to the id_rsa file. I verified that the file actually resided in the following location:
E:\BuildServerConfig\config\projects\MyProject\pluginData\ssh_keys where E:\BuildServerConfig is the Data directory.
But I got the following error
com.jcraft.jsch.JSchException: java.io.FileNotFoundException: E:\BuildServerConfig\config\projects\MyProject\pluginData\ssh_keys (The system cannot find the path specified)
I know the path is optional, when I removed the path it gave the following error
Unexpected error: java.lang.IllegalArgumentException: Argument for @NotNull parameter 'path' of jetbrains/buildServer/util/FileUtil.resolvePath must not be null
Could some please enlighten me on this?