dtctl ssh create
Usage
dtctl ssh create [flags]
Aliases
c
Description
Register an existing SSH public key with your account under a name, so it can be injected into virtual machines you create (pass the key name to dtctl virtual-machine create --ssh-key-name).
Set --public-key to the full contents of your public key file (for example ~/.ssh/id_rsa.pub). Registering a key does not modify any existing virtual machines.
Example
# Register a public key by reading it from a local file
dtctl ssh create --name my-key --public-key "$(cat ~/.ssh/id_rsa.pub)"
Response
In text output (the default), this command returns the following columns: Name, Public Key, Fingerprint, Created At, UserID.
Pass --output json to get the full response object instead.
Flags
| Option | Description |
|---|---|
--name, -n | Name to register the SSH key under (required) |
--public-key, -k | The full public key content (for example the contents of id_rsa.pub) (required) |
Related Commands
| Command | Description |
|---|---|
| dtctl ssh list | List SSH keys |
| dtctl ssh show | Show an SSH key |
| dtctl ssh delete | Delete an SSH key |
| dtctl ssh generate | Generate a new SSH key pair |
Global Flags
| Option | Description |
|---|---|
--api-url | Send this command to a different API endpoint, e.g. a test environment (default "https://console.dt.net.tr/api/v1") |
--config, -c | Specify a custom config file Default: ~/.config/dtctl/config.yaml |
--no-headers | Omit the column headers, for scripting Default: false |
--output, -o | Output format: text, wide, vertical, json. text fits the terminal, wide never truncates, vertical prints one field per line Default: text |