Merge pull request #6006 from dokku/josegonzalez-patch-1
Clarify how to specify the contents of an ssh key for dokku
This commit is contained in:
1 file changed
+21
-1
@@ -58,7 +58,7 @@ dokku ssh-keys:list --format json admin
|
|||||||
|
|
||||||
### Adding SSH keys
|
### 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:
|
You can add your public key to Dokku with the `ssh-keys:add` command. The path specified must contain your desired public ssh key contents and must exist on the server. Any special characters - such as `~` - are interpreted under the `dokku` user context. The output will be the fingerprint of the SSH key:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
dokku ssh-keys:add KEY_NAME path/to/id_rsa.pub
|
dokku ssh-keys:add KEY_NAME path/to/id_rsa.pub
|
||||||
@@ -72,6 +72,26 @@ SHA256:ABC123ABC123+abc123abc123Zabc123abcZ123abc
|
|||||||
|
|
||||||
> `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 its actions.
|
> `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 its actions.
|
||||||
|
|
||||||
|
Alternatively, you may pipe the contents of your ssh key via `cat` or `echo` into the `ssh-keys:add` command instead of specifying a path to the ssh key:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
echo "$CONTENTS_OF_YOUR_PUBLIC_SSH_KEY_HERE" | dokku ssh-keys:add KEY_NAME
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
SHA256:ABC123ABC123+abc123abc123Zabc123abcZ123abc
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
```shell
|
||||||
|
cat path/to/id_rsa.pub | dokku ssh-keys:add KEY_NAME
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
SHA256:ABC123ABC123+abc123abc123Zabc123abcZ123abc
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
Admin users and root can add keys remotely by specifying the `dokku` bin on their `ssh` command:
|
Admin users and root can add keys remotely by specifying the `dokku` bin on their `ssh` command:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
|
|||||||
Reference in new issue
Block a user