User Management
New
Introduced in 0.7.0
ssh-keys:add <name> [/path/to/key] # Add a new public key by pipe or path
ssh-keys:list # List of all authorized Dokku public ssh keys
ssh-keys:remove <name> # Remove SSH public key by name
When pushing to Dokku, ssh key based authorization is the preferred authentication method, for ease of use and increased security.
Users in Dokku are managed via the ~/dokku/.ssh/authorized_keys
file. It is highly recommended that you follow the steps below to manage users on a Dokku server.
Info
Users of older versions of Dokku should use the sshcommand
binary to manage keys. Please refer to the Dokku documentation for your version for more details.
Usage
Listing SSH Keys
You can use the ssh-keys:list
command to show all configured ssh keys. Any key added via the dokku-installer
will be associated with the admin
key name.
The output contains the following information:
- SSH Key Fingerprint.
- The
KEY_NAME
. - A comma separated list of ssh options under the
SSHCOMMAND_ALLOWED_KEYS
name.
Adding SSH Keys
You can add your public key to Dokku with the ssh-keys:add
command. The output will be the fingerprint of the ssh key:
KEY_NAME
is the username prefer to use to refer to this particular key. Including the word admin
in the name will grant the user privileges to add additional keys remotely.
Info
KEY_NAME
is a unique name which is used to identify public keys. Attempting to re-use a key name will result in an error. The ssh (git) user is always dokku
, as this is the system user that the dokku
binary uses to perform all it's actions.
Admin users and root can also add keys remotely:
Finally, if you are using the vagrant installation, you can also use the make vagrant-acl-add
target to add your public key to Dokku (it will use your host username as the USER
):
Removing SSH Keys
As key names are unique, they can be used to remove a public ssh key.
Scoping commands to specific users
Keys are given unique names, which can be used in conjunction with the user-auth plugin trigger to handle command authorization. Please see the documentation on that trigger for more information.