The Remote DB plugin for QGIS allows users to establish SSH tunnels to remote database servers, which can then be used for querying or other database operations within QGIS.
remote_db
plugin in QGIS.Note that it is the responsibility of the user to manage their local ports, ensuring that different database connections in their QGIS browser use different local ports.
Let's say you want to connect to a remote PostgreSQL database server with the following connection parameters:
example.com
22
5432
, this is the port that the database server is listening to.5433
, this is the local port to which the remote port will be forwarded. In your local machine, you can access the remote DB server in this port.john_doe
, a user on the remote machine, with ssh privilegesmy_password
, user's passwordTo set up a connection with the remote_db
plugin in QGIS:
example.com
.22
. Most machines listen for ssh connections in port 22. Server admins may change this setting for security reasons5432
.5433
. This will forward example.com:5432
to 127.0.0.1:5433
127.0.0.1
, and the port should be the local_port
you selected previously. Attention, YOU are responsible for managing your local ports. If you want to have many ssh connections to different servers open at the same time, you should configure them to use different local ports. You have to make sure that the local ports defined in the plugin's connections match the ports that are specified in QGIS's database connections parameters.john_doe
.my_password
.Connect
and you are good to go!For advanced users, it is possible to edit your connections.json file directly. Click the button 'Open Settings Folder' from the top of the plugin panel. A new window will open within the settings folder. Open connections.json with your prefered text editor and add your connection/s parameters manually. Available parameters are:
Parameter | Description |
---|---|
name |
Name of the connection, displayed in the list |
host |
IP or domain name of the remote host |
ssh_port |
Port listening for SSH |
username |
Username on the remote host |
password (optional) |
Password for the username on the remote host (optional) |
id_file (optional) |
SSH identity file (optional) |
pkey_password (optional) |
Passphrase for the SSH identity file (optional) |
ssh_proxy (optional) |
Proxy server to use for connecting to the remote host (optional) |
ssh_proxy_enabled (optional) |
Use the proxy server (optional) |
remote_port |
Port on the remote host to forward to localhost |
local_port |
Local port to expose the remote service on |
This is a new plugin. Although it has been tested in several machines, it is still very likely that bugs may arise, especially in installation. Please report any issues you have in the repository's Issues , or send me an e-mail .I ;ll be more than happy to troubleshoot with you!
Suggestions & pull requests are more than welcome.