Skip site navigation (1) Skip section navigation (2)

Re: Server not listening

From: Andy Shellam <andy(dot)shellam-lists(at)mailnetwork(dot)co(dot)uk>
To: George Heller <george(dot)heller(at)yahoo(dot)com>
Cc: pgadmin-support(at)postgresql(dot)org
Subject: Re: Server not listening
Date: 2007-04-25 19:03:59
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgadmin-support
Hi George,

Make sure you're using the latest PuTTY (something like 0.59 if I 
remember rightly.)
Then from the screen that opens when you run PuTTY, Load your saved 
On the right, browse to SSH, then Tunnels - add the settings in there 
(your tunnel should be shown in the "Forwarded Ports" dialog when you've 
added it.)

Then click back to Session (on the top-right) and save your settings 
Then connect and login to your server.

Don't open two SSH connections with the forwarded tunnel active, or it 
will do strange things.
You can then connect to your PostgreSQL server by connecting to 
localhost:5432 within PgAdmin.

Only the PostgreSQL port will be forwarded, so you cannot connect to SSH 
on localhost (unless of course you run a local SSH server on your XP 
machine ;))

If that doesn't work, close your SSH session, change the forwarded IP 
address in your tunnel configuration to your server's remote IP address, 
then re-connect.


George Heller wrote:
> Hi,
> Thanks for that mail. I tried to follow the steps to create a tunnel, 
> but when I add the connection, I dont really see an option to Save the 
> settings. So make the changes and log in to my server with the actual 
> hostname, it logs me in. I open another session on Putty, and the 
> changes I made in the port forwarding are gone, I make the changes 
> again, and try to log in using 'localhost' this time, it says 
> Connection refused.
> I also tried logging into PgAdmin using localhost, but it gave me the 
> same error as before, only this time it said ip address
> Thanks.
> George.
> */Andy Shellam <andy(dot)shellam-lists(at)mailnetwork(dot)co(dot)uk>/* wrote:
>     Hi George,
>     OK the fact you cannot telnet from your XP machine to the server's
>     PostgreSQL port now suggests it's a problem getting to the server
>     port.
>     Checking for the existence of a firewall is an ambiguous question I'm
>     afraid! There's not only the case of if there's a software firewall,
>     but is there a router between you and the server that's filtering out
>     other traffic?
>     What version of Linux are you running on the server?
>     Who originally set the server up?
>     Can they not tell you if there's a firewall on it?
>     Who set up the networks between you and the server?
>     Is there a router between you and the server, or a hardware firewall?
>     One thing that's just struck me that you can do in the interim
>     (which is
>     actually better security but doesn't really answer your question)
>     because you have SSH access, is to tunnel PostgreSQL over SSH.
>     This is
>     actually what I do, my firewall doesn't let anyone but the server
>     connect to PostgreSQL.
>     I take it you're using PuTTY to connect via SSH to the server? If so,
>     see this link to set up a tunnel.
>     In the tunneling setup in PuTTY (as described in the link above), set
>     the following:
>     Source port: 5432
>     Destination:
>     Set it as Local, and Auto
>     Add the tunnel, then save the connection. Now when you connect to
>     your
>     server via SSH, you'll have a port listening on 5432 on your local
>     machine. Whatever you send/receive from this port will be tunneled to
>     the server over SSH.
>     It's then as easy as instructing PgAdmin to connect to "localhost" on
>     port 5432, in the background it's actually connecting to your server.
>     HTH
>     Andy.
>     George Heller wrote:
>     > My XP machine is not in the same subnet as the server, but I
>     have the
>     > IP address of my XP machine specified in the pg_hba.conf file.
>     Is that
>     > not enough to let me access the database from my XP machine?
>     >
>     > I am able to do an SSH from my XP machine to the server, and
>     also can
>     > access psql using it.
>     >
>     > I am also able to ping from my XP machine to the server, and
>     this goes
>     > through fine.
>     >
>     > George
>     >
>     > */Raymond O'Donnell /* wrote:
>     >
>     > On 24/04/2007 06:43, George Heller wrote:
>     >
>     > > Ok, I tried a telnet from the command prompt of my XP machine,
>     > to the
>     > > linux server address on port 5432, something like,
>     > >
>     > > C:\> telnet 5432
>     > >
>     > > And this did 'not' go through. It said could not open
>     connection to
>     > > host, connect failed.
>     >
>     > Well, this sounds like a network problem, as others have suggested.
>     > Check that your XP machine and the machine with the PostgreSQL
>     server
>     > are on the same subnet, or are otherwise able to talk to each
>     > other. Are
>     > you able to use telnet or ssh to open a terminal session from one
>     > to the
>     > other? Did you try using psql to connect to the DBMS?
>     >
>     > Ray.
>     >
>     > ---------------------------------------------------------------
>     > Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
>     > rod(at)iol(dot)ie
>     > ---------------------------------------------------------------
>     >
>     >
>     >
>     ------------------------------------------------------------------------
>     > Ahhh...imagining that irresistible "new car" smell?
>     > Check out new cars at Yahoo! Autos.
>     >
>     >
> ------------------------------------------------------------------------
> Ahhh...imagining that irresistible "new car" smell?
> Check out new cars at Yahoo! Autos. 
> <*;_ylc=X3oDMTE1YW1jcXJ2BF9TAzk3MTA3MDc2BHNlYwNtYWlsdGFncwRzbGsDbmV3LWNhcnM-> 
> !DSPAM:37,462f7c2d89291991210244! 

In response to

pgadmin-support by date

Next:From: Joris DobbelsteenDate: 2007-04-25 19:09:28
Subject: Re: Server not listening
Previous:From: George HellerDate: 2007-04-25 16:04:44
Subject: Re: Server not listening

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group