SSH Keys
Depfloy uses SSH to access your servers. Your own keys are managed under System → SSH keys in the sidebar.
There are two scopes for SSH keys:
- Account level — keys stored against your Depfloy user. New servers get these keys automatically when they are provisioned.
- Server level — keys added to one specific server only. See Server Security for the server-scoped flow.
This page covers the account-level flow.
What is SSH? #
SSH (Secure Shell) is a protocol that allows you to access a server through a command-line terminal. SSH keys are used to authenticate your connection to the server over this protocol. Servers added to Depfloy are configured to use SSH, so you need an SSH key if you want to connect directly.
After your key is added to a server, you can SSH in without a password:
ssh depfloy@YOUR_SERVERS_PUBLIC_IP_ADDRESSIf you do not have an SSH key and do not know how to create one, GitHub’s documentation on generating an SSH key is a good starting point.
Who can add and remove keys #
A key placed on a server goes into the depfloy user’s authorized_keys, and that user has root on the server. Adding a key is therefore the same tier as opening a terminal:
- Adding a key — Add SSH Key on this page, Install on servers, and Add SSH Key in a server’s SSH keys section — needs the
terminal:writepermission: Owner, Admin and Developer. Manager and Viewer do not see these buttons; an empty list tells them “An Owner, Admin or Developer adds SSH keys.” - Removing a key — Delete from Depfloy, Delete from Depfloy and all servers, or deleting it in a server’s SSH keys section — needs permission to update servers: Owner, Admin, Manager and Developer.
The API follows the same rules; see API Reference → SSH Keys.
Add an SSH key #
For new servers #
When you are about to provision your first server, open System → SSH keys and click Add SSH Key in the page header. As part of the provisioning process, Depfloy will add all your active SSH keys to the depfloy user on every new server, so you can sign in without a password.
For existing servers #
A key you add is not placed on servers that already exist. To put it there, choose Install on servers in the key’s row menu, or open the server and use Add SSH Key in its SSH keys section — see Server Security.
Remove an SSH key #
A key’s row menu has two delete actions:
- Delete from Depfloy — removes the key from Depfloy; copies already installed on servers stay there.
- Delete from Depfloy and all servers — removes the key from Depfloy and from the servers as well.
Server public key #
When you provision a server, Depfloy generates a unique key pair on that server. This key pair is what Depfloy uses to manage the server itself. The public half is automatically added to the authorized_keys file for both the root and depfloy users.
Depfloy public key #
Depfloy also generates a per-server key for the depfloy user that is used for Git operations — cloning your project repositories during deployments. The public half is automatically registered with the source control provider you connected (GitHub, Bitbucket).
If you ever see SSH-related access problems on your source control provider’s side, check that this key is still listed under your provider’s deploy keys for the repository.