Conncting to RDBMS from MacOS

How to connect to the PostgreSQL RDBMS server from MacOS

Follow these steps on a Mac to generate your public/private keys and access the PostgreSQL server.

Access Terminal

Terminal (Terminal.app) is the terminal emulator included in the macOS operating system. You can use this application to generate your SSH key.

  1. Open a new Finder window
  2. Navigate to the Applications folder
  3. Navigate to the Utilities folder
  4. Open the Terminal app

Terminal

Generate Key

From Terminal, follow these instructions (see screenshot below):

  1. Type: ssh-keygen -t rsa
  2. Hit return to use the default file / location
  3. Enter a passphrase
  4. Enter your passphrase again
  5. Type: cat ~/.ssh/id_rsa.pub

In the screenshot below:

  • (a) is the location and filename of your private key
  • (b) is the location and filename of your public key
  • (c) are the contents of your public key

SSH Commands

Connect to PostgreSQL

Once your public SSH key has been installed on RDBMS, the administrator will provide you with login credentials to the SSH server as well as for PostgreSQL. You should be able to access PostgreSQL from a SQL client using those credentials. Some common SQL clients include: pgAdmin, DBeaver, Postico.

From your SQL client, use the settings mentioned below to connect. Be sure to select the Private Key that you generated above.

FieldValue
Hostlocalhost
Host Port5432
User<provided by Medic>
Password<provided by Medic>
Database<your project database>
SSH Hostrdbms.dev.medicmobile.org
SSH Port33696
SSH User<provided by Medic>
SSH PasswordN/A - Use Private Key
Private KeyUse the private key generated above

PG Connection Settings


CHT Applications > Quick Guides > Database > RDBMS from Windows

How to connect to the PostgreSQL RDBMS server from Windows