dtctl ssh generate
Usage
dtctl ssh generate [flags]
Aliases
g
Description
Generate a new SSH key pair and register it under a name, ready to be given to dtctl virtual-machine create --ssh-key-name.
The private key never leaves your machine as anything but a file: it is written to <name>.pem in the current directory (or the path given with --private-key-file), readable by you alone where the platform supports it. It is not printed, because a terminal keeps its scrollback, and it cannot be retrieved again — the platform keeps only the public half. Use --private-key-file - to write it to standard output instead, for a pipeline that stores it somewhere else.
Example
# Generate 'my-key', register it, and keep the private key in ./my-key.pem
dtctl ssh generate --name my-key
# Keep the private key where ssh looks for it by default
dtctl ssh generate --name my-key --private-key-file ~/.ssh/my-key
Response
In text output (the default), this command returns the following columns: Name, Fingerprint, Private Key File, Public Key, Created At.
Pass --output json to get the full response object instead.
Flags
| Option | Description |
|---|---|
--name, -n | Name to register the generated key under (required) |
--private-key-file, -p | Write the private key to this file instead of ./<name>.pem. Use - for standard output |
Related Commands
| Command | Description |
|---|---|
| dtctl ssh list | List SSH keys |
| dtctl ssh show | Show an SSH key |
| dtctl ssh create | Register an existing public key |
| dtctl ssh delete | Delete an SSH key |
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 |