SSH Tunneling
Connect your database via SSH tunnel
You can connect Postgres, MySQL, MSSQL, MongoDB, and other databases that are hosted under a private network via SSH tunnels.
  1. 1.
    Navigate Data sources - Connect Data Source. Select your database and check the Enable SSH tunnel option.
  2. 2.
    Additional details form will appear. Specify your bastion host and port number - usually this is an IP and an SSH port (22) of the server that holds the database
  3. 3.
    Copy SSH public key. UI Bakery will try to connect to your bastion host with the specific private key and the username uibakery
Enabling SSH option
Copying SSH public key
To establish the tunnel, It’s necessary to configure your bastion host to allow UI Bakery to connect:
  1. 1.
    Create UI Bakery user (UI Bakery will connect to your bastion as this user):
1
# Use this command if you use Amazon Linux
2
sudo adduser uibakery --password NP
3
4
# Use this command if you use any other Linux/Mac
5
sudo adduser uibakery --disabled-password
Copied!
2. To allow UI Bakery to connect to your bastion create a required folder structure and store the public key in the authorized_keys file:
1
# Login as root user
2
sudo su
3
4
# Create the authorized_keys file if it does not exist
5
mkdir -p /home/uibakery/.ssh
6
touch /home/uibakery/.ssh/authorized_keys
7
8
# Set required permissions and make uibakery user an owner of this file
9
chmod 644 /home/uibakery/.ssh/authorized_keys
10
chown uibakery:uibakery /home/uibakery/.ssh/authorized_keys
11
12
# Use any text editor and insert previously copied ssh public key in authorized_keys file
13
vim /home/uibakery/.ssh/authorized_keys
Copied!
Once configured, you can complete the data source connection and connect your database.
The same steps apply for on-premise deployments
Copy link