This article describes granting SSH/SFTP access to one or more Clouds that you administer in MODX Cloud by adding the authorized key to the specific Cloud instance. You would use this method if, say, you wanted to give access to one of your Clouds via SSH/SFTP to a contractor or collaborator but not to all the Clouds in your account. Alternatively, for trusted members of your team, and for yourself, Use SSH Keys to Access Clouds to access all Clouds you have permission to access in Cloud.
Before You Begin
You'll need to complete the following steps in oder to implement SSH Keys for your colleague or collaborator.
- You will need to set up your own SSH Key to access Clouds in your Account.
- Your colleauge or collaborator will need to generate an SSH keypair (the section entitled "Creating Secure SSH Keys") on the computer they'll use to access the site via SSH/SFTP.
Give SFTP or SSH Access Per Cloud
To add additional users for SSH/SFTP access:
- First, connect to the desired Cloud instance via SSH. You'll need to have your own SSH Key in place to do so.
-
Once connected, type in the following to update the list of allowed SSH keys which can connect to your instances:
nano ~/.ssh/authorized_keys - Go to the end of this file—a list of authorized public keys which can connect to the instance using the SSH user show in your Dashboard—by pressing the
down-arrowkey, and add a new line with theenter-key. You'll want to copy/paste the public key from your team member onto this line. You can add multiple keys at once, just put each one on a new line. - To save the authorized_keys file, press
ctrl+xwhen you are done adding keys, at the save prompt pressy, then press theenter-keywhen it asks if you want to save over the file.
Testing SSH Connections
Assuming the Cloud instance to which you are granting users access is c0000@abcde123.modx.dev, have your colleague enter the following command after doing so at their terminal (modified to match your actual internal MODX Cloud URL):
ssh c0000@abcde123.modx.devIf the key is valid, they will be prompted to add the host to your local ~/.ssh/known_hosts file; do so. If this works you can then add additional team members to your instance in the same way as above.