A walkthrough which covers creating a gateway server with AWS
strongDM gateway(s) create a secure tunnel to access all of your servers, databases, and internal website resources. This allows your team to connect to infrastructure without managing credentials for each, or worse, sharing them. This Quick Start Guide will walk you through the steps to connect to your first datasource through strongDM.
You will need a Linux server upon which to host the strongDM gateway, as well as root or sudo access to it.
5000. If you must alter the port, it is advised to use one above 1024.
Navigate to the strongDM Admin UI. Select the Gateways tab and click add gateway.
Define the advertised host for the server (e.g.
ec2-nn-nnn-nnn-nnn.us-east-2.compute.amazonaws.com). It must be an IP or hostname accessible to your strongDM clients. Enter the port that you left open for the gateway to interact with strongDM clients (by default,
Click create. This generates a token which is only shown to you one time that you’ll need to use later in the installation process. Carefully copy the token and save it somewhere for later use.
Log in to the server you created to host your gateway.
Download the SDM binary:
$ curl -J -O -L https://app.strongdm.com/releases/cli/linux
Unzip it (if this is a new server, you may need to install a package to unzip archives, such as with
sudo apt-get install unzip on Ubuntu distributions):
$ unzip sdmcli_VERSION_NUMBER_linux_amd64.zip
Install the gateway:
$ sudo ./sdm install --relay
You will be prompted for the token you created above; paste it in and hit enter. Note that the token won’t show in the terminal for security purposes, similar to the masking of a password.
Note: The installer must be run by a user that exists in the
/etc/passwd file. Any users remotely authenticated, such as with LDAP or an SSO service, may fail to complete the installation.
Log in to the strongDM Admin UI. In the Gateways tab, the gateway you created should appear to be online, and have a heartbeat. If it doesn’t appear online with a heartbeat within a couple of minutes, log out, log in, and check again.
A database within strongDM is referred to as a “datasource”. This entity represents the combination of both a logical database and a set of permissions. Note that, as previously mentioned, you must ensure that the datasource you’re attempting to add is accessible from the gateway you created.
Navigate to the Datasources tab in the strongDM Admin UI and click the add datasource button. You will be prompted to fill out information about the datasource.
Type in a Display Name. This is the name that will appear for all end users who are granted access. In this case, we will use “testdb-01”.
Select the Datasource Type from the available list (in this case, PostgreSQL). Enter the Hostname. It’s imperative that the entry you choose for the hostname is one that the gateway server can connect to. To verify this, hop on the gateway server and use Netcat:
nc -zv <YOUR_HOSTNAME> <YOUR_PORT> (in this example,
nc -zv testdb-01.fancy.org 3306). If your gateway server can connect to this hostname, proceed.
Note: Netcat is an easy tool to check various hostnames and ports by either sending data (a ping) or checking for listeners on the ports. The commands above use -z to check for listeners without sending data and -v to show verbose output. If you don’t have Netcat, you can install the
netcat package with whatever package manager you are using, such as
apt-get install netcat
Unless your database is set to connect on a different port, accept the pre-populated port assignment and port override assignment.
Type in the name of the database you will be connecting to with this datasource, the username that the gateway will use to connect to the database, and the password of the database user.
Note: By default, for PostgreSQL and its derivative DBMS (e.g. Greenplum), strongDM will limit all connections to the configured database only. If you would like to change that, uncheck the Override Database option.
Click the create button. Once this is done, the Admin UI will update. Within a few moments, the state will appear green, and the process is complete. If it doesn’t turn green, this may indicate a problem.
Navigate to the Users tab in the strongDM Admin UI. Select your username, then the Datasources tab that appears below. Select the datasource you just created to grant yourself access.
If you haven’t already set up your strongDM client, click Download in the top bar and complete the installation steps relevant to your OS:
Open the strongDM client you installed on your local machine and log in. Upon authentication, the datasource you created and assigned to yourself should appear in the list of available resources.
Click the datasource and a green lightning bolt will appear. This indicates that a tunnel has been opened between the strongDM client and the destination datasource.
Note: If the status at the top of the SDM panel says “reconnecting” instead of “online” and does not change, it means that your client is not capable of connecting to your gateway server. You should ensure that you have port 5000 open on the gateway server. For tips on what the problem might be, you can run
sdm doctor -v, which will give you a status report and information about problems that sdm might be encountering.
Open your preferred SQL client (in this example, TablePlus), and create a new connection. Enter
127.0.0.1 (for some clients, this will need to be
localhost) and the port that was assigned in your strongDM client (in this example,
5472). For most clients, leave the username and password blank as all authentication occurs through strongDM. If you are using a different SQL client, confirm the connection settings in the Connecting to Databases documentation, as each client has different requirements.
Now all you have to do is connect, and start executing queries - without ever needing database credentials from the client’s perspective.