这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion docs/deployment/user-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ dokku ssh-keys:list --format json admin

### 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
dokku ssh-keys:add KEY_NAME path/to/id_rsa.pub
Expand All @@ -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.

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:

```shell
Expand Down