0

I have a postgres database running on a NAS Synology DiskStation (DS216j). I set this up using ubuntu and modify the files pg_hba.conf and postgresql.conf through SSH.

I would like to access to the db from a computer outside my local network and perform changes.

  • I enebled from the NAS control panel the option: quickconnect. This allow a remote computer to have access to the NAS where the file of the databases are. However when I click on my Libreofficebase database file, I can see the structure, but I wont be able to open the file after insert user/psw.

This is the error I get form LibreOffice base: enter image description here

  • I have created a second user on the database.
  • I have created a second user on the control panel of the NAS.

  • Do I have to change something in the files: pg_hba.conf or postgresql.conf ?
  • Do I have to enable/set something in my router?
  • Do I have to have a static IP address on my router?
  • Any kind of driver issue?

If anybody had this experience any help will be apprecciated.

closed as off-topic by mustaccio, Marcello Miorelli, Gaius, John Eisbrener, kevinsky Aug 12 at 13:03

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

  • postgresql.conf has listen_address='*' variable and pg_hba has to have definition for user to connect. see examples in file. (there might be some other stuff to change if you have changed your ubuntu setup) – simplexio Jul 20 '17 at 11:19
0

If you are not familiar with the following network concepts: NAT (masquerading), DHCP, DNS, port forwarding, static versus dynamic IP addresses, VPNs, gateways, protocols and port numbers - then this setup can be very tricky, as any of these items may need configuring and hence can trip you up.

Quickconnect - Looking into Synology's white paper, you can see that DSM uses a "third party" ie its QuickConnect Server to establish a connection between the local NAS box (on your LAN) and remote computer. On page 11 (of the document) there is a list of supported services. You see that this is mostly about file sharing in the traditional sense - no connections to databases listed here!

Router settings - 2 main problems: The remote machine needs to "know" where your router is ie it needs its public IP address, which may change at irregular intervals, if you don't have a static IP address. Moreover, the router needs to be set to allow traffic (originating from the outside!) to your NAS box. For setting up the router, it may be an idea to configure SSH first, so that you can use ssh from the remote machine (using the router's public address, and port forwarding) to your NAS.

There is much more that could be written about this scenario and its possible solutions. It seems that this is not a problem where one can say: click this, set that, done. If you are using a router that allows VPN connections (ie has a built-in VPN server), it may be an idea to explore this first. If you manage to establish a VPN into/with your local area network from the remote computer, then you will be able to use the "private" IP address of your NAS ie 192.168.0.20 - same as in your screen shot. However, for the VPN to work, you need to know the public IP address of your router (as mentioned in the previous paragraph).

Not the answer you're looking for? Browse other questions tagged or ask your own question.