Skip to main content

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​

OptionDescription
--name, -nName to register the generated key under (required)
--private-key-file, -pWrite the private key to this file instead of ./<name>.pem. Use - for standard output
CommandDescription
dtctl ssh listList SSH keys
dtctl ssh showShow an SSH key
dtctl ssh createRegister an existing public key
dtctl ssh deleteDelete an SSH key

Global Flags​

OptionDescription
--api-urlSend this command to a different API endpoint, e.g. a test environment (default "https://console.dt.net.tr/api/v1")
--config, -cSpecify a custom config file
Default: ~/.config/dtctl/config.yaml
--no-headersOmit the column headers, for scripting
Default: false
--output, -oOutput format: text, wide, vertical, json. text fits the terminal, wide never truncates, vertical prints one field per line
Default: text