SSH (Public key)
Use the SSH (Public Key) resource type to connect to your SSH servers via an automatically generated public key (managed by StrongDM) that you install on your host.
Overview
This guide describes how to set up an SSH server with a public key. The SSH (Public Key) resource type allows StrongDM to automatically generate an SSH key pair for a given server resource, publish the public key for you to install on the target host, and then allow the StrongDM node (gateway, relay, or proxy worker) to connect as that key.
This setup is especially useful when you want to avoid managing a private key yourself, but you still want the benefits of public-key authentication (that is, no passwords) and centralized resource management via StrongDM.
Some of the benefits of using this resource type include the following:
There is no need to generate or install your own key pair manually.
StrongDM handles public key generation and management.
StrongDM generates the key, you paste it into
authorized_keys, and then the resource shows as healthy.This is ideal for environments where certificate authentication isn’t desired or you just need simple public-key setup.
Authentication
When you create an SSH (Public Key) server resource:
StrongDM generates a key pair, which is a private key stored by/handled by StrongDM and a public key you install on the host.
You install the public key into the target host’s
~/.ssh/authorized_keysfor the specified user.When a user connects via StrongDM, the relay uses the private key (managed by StrongDM) to authenticate to the SSH host.
The SSH host verifies the public key (that you installed) and allows the connection.
Because the private key is never exposed to you, and StrongDM manages it, this approach simplifies key lifecycle management while still relying on SSH public key authentication.
Prerequisites
Before you begin setting up the SSH (Public Key) resource, ensure that the following requirements are met:
You have Admin privileges in StrongDM.
A StrongDM node is running and can reach the target SSH host (hostname/IP and port).
The host allows SSH public-key authentication for the user you intend to login as.
You know the username on the host that StrongDM will use for the SSH login.
If using Virtual Networking Mode or a non-default port, ensure that your node and host network/firewalls allow it.
(Optional but recommended) The host’s
~/.ssh/authorized_keysdirectory and file permissions are correctly configured (for example,700for.ssh,600forauthorized_keys).
Add the Resource in StrongDM
After the host is ready, add the resource in StrongDM. This section provides instructions for adding the resource in either the StrongDM Admin UI, CLI, Terraform provider, or SDKs.
Set up and Manage With the Admin UI
If using the Admin UI to add the resource to StrongDM, use the following steps.
Log in to the Admin UI and go to Resources > Servers.
Click the Add server button.
Select SSH (Public Key) as the Server Type and set other resource properties to configure how the StrongDM relay connects to the server via SSH.
Click create to save the resource.
Click the resource name to view status, diagnostic information, and setting details.
Click the Settings tab to view the Public Key field, which now contains data.
Copy the Public Key value to your clipboard.
Open a command prompt on the server you are adding. Edit the
authorized_keysfile for the user specified in the server configuration properties:Append the generated public key value to the end of the file, write, and quit.
Back in the Admin UI, click update. As the configuration is applied, the server status in the Admin UI appears unhealthy. It turns green or positive to signal a successful connection. If you have multiple servers to create, follow these steps for each server.
Set up and Manage With the CLI
This section provides general steps on how to configure and manage the resource using the StrongDM CLI. For more information and examples, please see the CLI Reference documentation.
In your terminal or Command Prompt, log in to StrongDM:
Run
sdm admin servers add ssh --helpto view the help text for the command, which shows you how to use the command and what options (properties) are available. Note which properties are required and collect the values for them.Run
sdm admin servers add ssh <RESOURCE_NAME>to add the resource in StrongDM. Set all required properties with their values. For example:Check that the resource has been added. The output of the following command should show the resource's name:
Set up and Manage With Terraform
This section provides an example of how to configure and manage the resource using the Terraform provider. For more information and examples, please see the Terraform provider documentation.
Set up and Manage With SDKs
In addition to the Admin UI, CLI, and Terraform, you may configure and manage your resource with any of the following SDK options: Go, Java, Python, and Ruby. Please see the following references for more information and examples.
Resource properties
Configuration properties are visible when you add a Server Type or when you click to view the server's settings. The following table describes the settings available for your SSH (Public Key) server.
Display Name
Required
Meaningful name to display the resource throughout StrongDM; exclude special characters like quotes (") or angle brackets (< or >)
Server Type
Required
SSH (Public Key)
Proxy Cluster
Required
Defaults to "None (use gateways)"; if using proxy clusters, select the appropriate cluster to proxy traffic to this resource
Hostname
Required
Hostname or IP address to which you are connecting, such as testserver-01.example.org; relay server should be able to connect to your target server or hostname
Port
Required
Port to connect to the resource; default port value 22
Connectivity Mode
Required
Select either Virtual Networking Mode, which lets users connect to the resource with a software-defined, IP-based network; or Loopback Mode, which allows users to connect to the resource using the local loopback adapter in their operating system; this field is shown if Virtual Networking Mode enabled for your organization
IP Address
Optional
If Virtual Networking Mode is the selected connectivity mode, an IP address value in the configured Virtual Networking Mode subnet in the organization network settings; if Loopback Mode is the selected connectivity mode, an IP address value in the configured Loopback IP range in the organization network settings (by default, 127.0.0.1); if not specified, an available IP address in the configured IP address space for the selected connectivity mode will be automatically assigned; this field is shown if Virtual Networking Mode and/or multi-loopback mode is enabled for your organization
Port Override
Optional
If Virtual Networking Mode is the selected connectivity mode, a port value between 1 and 65535 that is not already in use by another resource with the same IP address; if Loopback Mode is the selected connectivity mode, a port value between 1024 to 64999 that is not already in use by another resource with the same IP address; when left empty with Virtual Networking Mode, the system assigns the default port to this resource; when left empty for Loopback Mode, an available port that is not already in use by another resource is assigned; preferred port also can be modified later from the Port Overrides settings
DNS
Optional
If Virtual Networking Mode is the selected connectivity mode, a unique hostname alias for this resource; when set, causes the desktop app to display this resource's human-readable DNS name (for example, k8s.my-organization-name) instead of the bind address that includes IP address and port (for example, 100.64.100.100:5432)
Secret Store
Optional
Credential store location; defaults to none (credentials are stored in StrongDM resource configuration); to learn more, see Secret Store options
Key Type
Required
Signing algorithm with default value set to RSA-2048; other options include RSA-4096, ECDSA-256, ECDSA-384, ECDSA-521, and ED25519; to learn more, see Key Type options
Username
Required
Displays if Authentication is set to Leased Credentials; enter the username the relay should utilize to connect to the server via SSH (for example, bob.belcher)
Public Key
Read only
Generated automatically after the server is created or updated; once generated, you must append the public key to the ~/.ssh/authorized_keys on the host
Allow Port Forwarding
Optional
When enabled, allows SSH connections proxied by StrongDM for this server to accept local forwarding requests; this checkbox is shown when the Allow port forwarding through SSH? option is turned on in the Admin UI security settings; see Port Forwarding for more information
Resource Tags
Optional
Resource Tags consisting of key-value pairs <KEY>=<VALUE> (for example, env=dev)
Secret Store options
By default, server credentials are stored in StrongDM. However, these credentials can also be saved in a secrets management tool.
Non-StrongDM options appear in the Secret Store dropdown if they are created under Settings > Secrets Management. When you select another Secret Store type, its unique properties display. For more details, see Configure Secret Store Integrations.
Key Type options
The following table describes the different key types StrongDM can use to encrypt and secure SSH connections.
RSA-2048
2048-bit key generated with RSA algorithm
Lowest security guarantees, but has broad support across hosts
RSA-4096
4096-bit key generated with RSA algorithm
Slightly better than RSA-2048; still uses RSA, but larger keys can prolong the time to crack if an attacker gains access
ECDSA-256
Key generated with 256-bit elliptic curve and ECDSA algorithm
Provides better security guarantees than RSA
ECDSA-384
Key generated with 384-bit elliptic curve and ECDSA algorithm
Slightly better than ECSDA-256
ECDSA-521
Key generated with 521-bit elliptic curve and ECDSA algorithm
Serves as the best ECDSA choice from a security standpoint
ED25519
Key generated with ED25519 algorithm
Provides the best performance and comparable security to ECDSA; much smaller keys, but not as widely supported as other options
Test the Connection
After adding the resource, follow these steps to test the connection.
In the Admin UI, check that the resource shows a healthy status.
From the StrongDM CLI or desktop app, attempt a connection. Replace
ubuntuand the resource name with your values.On the host, verify that you are logged in as expected.
If the resource is unhealthy:
Verify the matching public key is present in
~/.ssh/authorized_keys.Check host logs (
/var/log/auth.log,/var/log/secure) for SSH errors.Confirm network connectivity from the node to the host.
Ensure that the username configured in the resource matches one with the public key installed.
Confirm permissions/ownership on the host
.sshdirectory andauthorized_keys.
If you still encounter issues, please consult the StrongDM Help Center.
Last updated
Was this helpful?

