Copy SSH Keys
What does Copy SSH Keys do?
The Copy SSH Keys directive will add a public SSH key to the ~/.ssh/authorized_keys file on a remote server for you. This is handy when you need to add another person’s public key to a server so that they can access the server too.
Note that you must have access to the target server on which you want to add the new SSH public key. If the server has blocked your access, this directive will fail to run.
How do I use the Copy SSH Keys directive?
In order to use this directive, you must specify:
- Target server IP address
- Target server port
- Username to SSH login to server
- Password or SSH key to login to server
Finally, you must specify the public SSH key you want to add. If you do not know the public SSH key beforehand, you can use the Ask User Input directive to specify a key during runtime.
Behaviour of the Run Remote Command directive
- You must already have access to the server. If Proggy cannot connect to the server, your Prog command will exit.
- Proggy performs a validation of your SSH key if the inputted value is not a Liquid variable (ie. surrounded by curly braces
{{ user_inputed_key }}
). Validation will fail if the public key is invalid. - The SSH key added will be under the home directory of the logged in user. This means that when adding SSH keys onto a server, you must be logging in as the user you want to add the key to.
Example use cases for the Run Remote Command directive
- Common devops task of adding a user to a user login