Connecting Your First SRA Resource
This guide walks you through connecting your first protected resource for SRA.
As a concrete example, it walks through an SSH session to a target host and connecting to it using the Akeyless Connect CLI command. In this example, the target host is an Ubuntu server.
check our Supported Resource Types.
Configuration takes place in the Akeyless Console. Connection is established via CLI using an API Key.
By the end, you'll have a real SSH session open from your terminal, proxied through SRA to your target host.
Prerequisites
- Gateway with SRA.
- An existing SSH Certificates Issuer
- A target host reachable over SSH.
- Console access with permission to edit SSH Certificate Issuers.
- The akeyless CLI installed.
Note:This guide continues from the Quick Start Guide, where the Gateway was deployed without TLS.
We strongly recommend not using this setup in production or with real credentials.
To configure your Gateway with TLS, see our TLS Settings doc.
Allow Gateway Access to the Host
- Allow outbound traffic from the gateway pod to the target host on
port 22, In your cluster, this pod is namedssh-gw-akeyless-gateway-.... - Allow inbound traffic on the target host's firewall or security group from the gateway pod's IP/CIDR or node/subnet range on
port 22.
If this step is skipped, every step that follows will still appear correctly configured, but the connection will fail.
Enable SRA on SSH Certificate Issuer and set the target
Edit the existing SSH Certificate Issuer created during the Gateway deployment directly in the Akeyless Console.
Navigation: Console → Items → locate the existing SSH Certificate Issuer → Secure Remote Access
- Click Edit pen.
- Check the Enable Secure Remote Access checkbox.
- Click Add and enter the target host's IP address.
- Set Default SSH Username to
ubuntu. - Click Save.
Create an Authentication Method
This Authentication Method authenticates the user connecting to your resource. For this guide, API key authentication is used for simplicity.
Note:To connect using Akeyless's SRA web portal -
either the public facing ZeroTrust portal athttps://zerotrust.akeyless.ioor your internal GW SRA Portal athttps://<gateway-host>:8000/sra/portal
you must use SAML, OIDC, or certificate-based authentication. Note that LDAP is supported only on the GW SRA Portal.
akeyless auth-method create api-key --name MySraAPIKeyCreate an Access Role
This Access Role authorizes your SRA user to connect to the resource.
-
Create a new access role:
akeyless create-role --name MySraRole -
Grant the role
listandallow_accesspermissions on the SSH Certificate Issuer's path:akeyless set-role-rule --role-name MySraRole --path "/path/to/ssh-certificate-issuer" --capability list --capability allow_access -
Associate the authentication method with the role:
akeyless assoc-role-am --role-name MySraRole --am-name MySraAPIKey
Connect to Resource via CLI
Authenticate the CLI with your API key (Access ID and Access Key):
akeyless auth --access-id <your-access-id> --access-key <your-access-key>Copy the user t-token and connect:
akeyless connect \
-t "ubuntu@<host-ip-address>:22" \
-c <cert-issuer-name> \
-v <Gateway-SSH-EXTERNAL-IP>:22 \
-g https://<Gateway-EXTERNAL-IP> \
--token <t-token>where:
-tThe OS user and target host/port to connect to. Must match the SSH username and host configured on the certificate issuer.-cThe existing SSH Certificate Issuer with Secure Remote Access enabled.-vThe external endpoint of your Gateway's SSH Access service, theEXTERNAL-IP(or DNS name) retrieved viakubectl get servicesof the service starting withssh-quick-start-gw,and port22exposed by the SRA SSH service.-gThe base URL of your Akeyless Gateway, the endpoint the CLI uses to authenticate the session and issue the SSH certificate, e.g.http://<Gateway-EXTERNAL-IP>:8000retrieved viakubectl get servicesof the service starting withquick-start-gw.--tokenThe user token to Akeyless.
Landing in a real shell on your target host with the banner "You are connecting to your remote server via Akeyless Bastion", confirms that SRA is working end-to-end.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| Connection times out | Step 1 (network/firewall) was skipped or the pod's IP/CIDR isn't actually allow-listed on the target host | Re-check the target's firewall/security group against the SRA SSH gateway pod's real egress IP or subnet |
| "Permission denied" when session opens | Username not included in Allowed Users, or Secure Access SSH Creds User doesn't match a real OS user on the target | Re-check both fields on the issuer against the actual OS username on the target host |
Updated about 3 hours ago
