Hi Guys,
We have a similar setup working i.e. deployment to a target server through gateway server. We are using Webistrano for our deployments that uses capistrano recipes to handle the deployments. Regardless of the software (Webistrano), I think if you implement the same flow, you most probably will have success.
Here is the setup:
Deployment server (DS): The server from where you will trigger the deployment.
Gateway Server (GW): The server that you will use to access the target server
Target server (TS): The server where your deployments take place.
We have implemented password-less authentication i.e. ssh key based authentication. This make your life a lot easier. So what you can do is:
Create a user e.g. 'capistrano' on DS, generate its ssh keys using ssh-keygen.
Copy this user's id_rsa.pub (the public key, inside the .ssh directory).
Create same user on GW, generate its ssh keys using ssh-keygen.
Add DS user's public key to GW user's authorized keys (authorized_keys files under .ssh folder)
Test the ssh access from DS to GW, should work.
Create same user on TS, generate its ssh keys using ssh-keygen.
Add DS user's public key to TS user's authorized keys (authorized_keys files under .ssh folder)
That's all you need. Modify the recipe accordingly to set the user/gateway accordingly and test your setup.
Hope this helps!