Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Remote access recommendations

Remote access recommendations

Scheduled Pinned Locked Moved The Lounge
databasepostgresqllinux
26 Posts 7 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • pkfoxP pkfox

    Hi there, I'm unsure about what I need to port forward in my router and Putty, I see in your screenshot you have 127.0.0.1:5432 ; does that mean I need to port forward 5432 in my router to my database server ? and also put my public ip address in the host text box in Putty ? sorry for all the questions but I've not worked with tunneling before :-D Edit I think I've done it though maybe not the way you suggested :-D - this is what I've done Forwarded port 22 in my router to my local Linux box Forwarded a port xxx in my Putty connection to my local Linux box Changed the port number in my connection string to xxx It worked !!! I'm amazed - thanks for all your help

    "We can't stop here - this is bat country" - Hunter S Thompson - RIP

    C Offline
    C Offline
    CCostaT
    wrote on last edited by
    #21

    Hi, sorry for taking so long to reply (looong weekend..). If I understand correctly then yes, that setup should work both locally on your network as well as remotely :) I should probably make a guide on how to set this up because with all the forwarding going on it gets really confusing really fast. Anyway let me know if you have any more trouble :) And if you want to make everything a little bit more secure, checkout how to connect using a key pair instead of a username/password

    pkfoxP 1 Reply Last reply
    0
    • C CCostaT

      Hi, sorry for taking so long to reply (looong weekend..). If I understand correctly then yes, that setup should work both locally on your network as well as remotely :) I should probably make a guide on how to set this up because with all the forwarding going on it gets really confusing really fast. Anyway let me know if you have any more trouble :) And if you want to make everything a little bit more secure, checkout how to connect using a key pair instead of a username/password

      pkfoxP Offline
      pkfoxP Offline
      pkfox
      wrote on last edited by
      #22

      Hi and thanks again, I already use keys - I’ve been using SSH for years it just never occurred to me to use port forwarding in Putty - I run SSH and PostgreSQL on non standard ports which is an added complication- what I used to do was forward the Postgres port in my router which is not ideal - with your method I have the added benefit of SSH security - and as you say it works remotely

      "We can't stop here - this is bat country" - Hunter S Thompson - RIP

      C 1 Reply Last reply
      0
      • pkfoxP pkfox

        Hi and thanks again, I already use keys - I’ve been using SSH for years it just never occurred to me to use port forwarding in Putty - I run SSH and PostgreSQL on non standard ports which is an added complication- what I used to do was forward the Postgres port in my router which is not ideal - with your method I have the added benefit of SSH security - and as you say it works remotely

        "We can't stop here - this is bat country" - Hunter S Thompson - RIP

        C Offline
        C Offline
        CCostaT
        wrote on last edited by
        #23

        Ah! Sorry for some reason I thought you didn't know about ssh keys :doh: Anyway I'm glad it works :) It's amazing what PuTTY and SSH can do for such "simple" programs. On a side note, be carefull about not running ssh on a standard port. You are giving up some linux protections when doing that.

        pkfoxP 1 Reply Last reply
        0
        • C CCostaT

          Ah! Sorry for some reason I thought you didn't know about ssh keys :doh: Anyway I'm glad it works :) It's amazing what PuTTY and SSH can do for such "simple" programs. On a side note, be carefull about not running ssh on a standard port. You are giving up some linux protections when doing that.

          pkfoxP Offline
          pkfoxP Offline
          pkfox
          wrote on last edited by
          #24

          Oh really what exactly ?

          "We can't stop here - this is bat country" - Hunter S Thompson - RIP

          C 1 Reply Last reply
          0
          • pkfoxP pkfox

            Oh really what exactly ?

            "We can't stop here - this is bat country" - Hunter S Thompson - RIP

            C Offline
            C Offline
            CCostaT
            wrote on last edited by
            #25

            This is only true if you use a port above 1024. Ports bellow 1024 are given some extra "protections" by Linux, one of them being that your program must be executed as root to be able to bind to them. This means that if you use a port >1024 and get infected by something, that something can bind to that port, act like a ssh server and capture everything you are doing. As usual there are tons of discussions and opinions about this if you want to take a look: - Why not move SSH to another port? - BSD How To[^] - Why putting SSH on another port than 22 is bad idea[^] - Why putting SSH on another port than 22 is bad idea | Hacker News[^] This is probably overkill for what you and I do but I like to keep it safe (and I had to worry about this kind of stuff on a previous job although I'm not a security expert, not even close, so keep that in mind). One way to keep both benefits is to keep ssh on port 22 on your linux box but port-forward a random >1024 port on your router to port 22. Is this worth it? I'm not sure but at least it's one less thing to worry about.

            1 Reply Last reply
            0
            • pkfoxP pkfox

              Hi all, I need to remotely access my home Linux hosted Postgresql database remotely - I'm thinking maybe a VPN is the way to go but thought I'd ask you lot first

              "We can't stop here - this is bat country" - Hunter S Thompson - RIP

              P Offline
              P Offline
              pmauriks
              wrote on last edited by
              #26

              If it's only for you, consider SSH. You can use putty on a Windows machine to do port redirection if you need to. On linux its not much harder. Depends a little on how permanent it needs to be.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups