[Qgis-user] Question about Postgis connection

Matt Boyd mattslists at gmail.com
Tue Jan 4 14:01:44 PST 2011


I've been using ssh tunnels for this and other things for a while. The
only downside is that I when I connect to the database QGIS uses
"localhost" or 127.0.0.1 for the database location which is written to
the qgis project file.
When my location changes and I'm on the same subnet as the postgresql
machine and ssh port forwarding slows things down or I want to
transfer the project file I open up the QGIS project file in a text
editor and do a search and replace for "localhost".

I'm not sure how often your IP changes but you could try limiting
access by hostname and using one of the dynamic DNS services. I
haven't done this so I'm not sure how well it would work.

Matt

On Wed, Jan 5, 2011 at 7:22 AM, Alex Mandel <tech_dev at wildintellect.com> wrote:
> On 01/04/2011 12:12 PM, Marcos Sobral wrote:
>> Hi,
>>
>> I have a dynamic IP, and I need to conect to a postgis DB usign Quantum. The
>> issue is that in order to have a secure environment I cannot allow to acces
>> any IP to my server. So what I have todo every time I want to connect is to
>> correct my pg_hba.conf.
>>
>> I think that if I could connect using a ssh tunel this would be solved, and
>> I'd have a secure way to connect my DB.
>>
>> Does anyone knows if Quantum alows me to connect using a ssh tunel?
>>
>
> Sure that would work, but you will need to setup the ssh tunnel and port
> forwarding oustide QGIS.
>
> On a linux box here is an example from my .ssh/config
> Host machine
> Hostname machine.com
>        User myuser
>        Localforward  5433 localhost:5432
>
> On windows the same can be done with PUTTY.
>
> In QGIS the connection would be to localhost or 127.0.0.1
> Port would be 5433, note I change the port so it doens't conflict if I'm
> running a postgres db locally too.
>
> Enjoy,
> Alex
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-user
>



More information about the Qgis-user mailing list