1

i have a jenkins that run inside a docker container (on a server A) and i want to publish an artifact over ssh in a server B.

I have installed the plugin "publish over ssh" in Jenkins but i don't know how to configure the ssh.

I guess that i must generate a public/private key on the server A and send my public key on the server B. But for which user?

I have a user jenkins on the server B but not on the server A. Should i generate the key with the same user that run the docker on the server A? Where should I put my keys?

Thanks.

1 Answer 1

0

Your question seems to relate more to using ssh than the fact that you're running Jenkins in Docker. So I'll focus on that.

When using ssh keypairs, you'll want to generate your keypair client-side and provide the public key to the host. So you're right that you want to generate on server A and share your key with server B.

For which user you want to add the key depends on where you add the key to the authorized_keys-file on server B. It doesn't matter what users you have on server A, as long as you ssh into server B using the correct user.
e.g.: if you have added the key to the authorized_keys-file for user foo on server B, then you'll want to ssh into it using something akin to ssh foo@server_b.

As for the location of storing your keys, the keypair will usually reside in ~/.ssh on your client. And, as stated above, the content of the public key will be stored as a line in the authorized_keys-file on the host.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .