# [SOLVED] SSH port forwarding stopped working

## Mr. M

Guys,

For some reason port forwarding from my PC at home to my PC at work stopped working. I have been using this setup for several years and haven't made any changes recently (other than that I updated both machines last weekend). Anyways, the error I get is:

```

debug1: Connection to port 1111 forwarding to WORKPC port 1111 requested.

debug1: channel 5: new [direct-tcpip]

channel 5: open failed: connect failed: Connection refused

debug1: channel 5: free: direct-tcpip: listening port 1111 for WORKPC port 1111, connect from 127.0.0.1 port 41851, nchannels 6

```

I highly appreciate tips on what could be causing this problem. I already checked the sshd config file and everything looks fine (port forwarding is allowed).

Best,

MLast edited by Mr. M on Tue Apr 05, 2011 3:11 pm; edited 1 time in total

----------

## muhsinzubeir

Have you checked 

```
grep Port /etc/ssh/sshd_config 
```

 ?

----------

## Mr. M

 *muhsinzubeir wrote:*   

> Have you checked 
> 
> ```
> grep Port /etc/ssh/sshd_config 
> ```
> ...

 

Thanks for your reply. I get:

```

grep Port /etc/ssh/sshd_config

#Port 22

#GatewayPorts no

```

AFAIK enabling "GatewayPorts" is not necessary (I tried and it didn't change anything).

----------

## muhsinzubeir

Doesnt that mean that the PC you are connecting is set to 22 port and you are making a connection to port 1111 ?.

I was suspecting that when you said that you have updated your systems, which creates a possibility for config file to be changed.

----------

## Hu

Could you show the exact ssh command you run, and describe what you want to happen?  I would rather not try to guess at your desired behavior from the debug output.

----------

## Mr. M

Sorry for not giving enough details in my first post. Anyways, it turns out the problem was not ssh related. I am using port forwarding to connect to an apache server on WORKPC running on port 1111. I must have accidentally overwritten the apache configuration file during a recent update, so apache was no longer running on port 1111 and ssh couldn't connect to the port, resulting in an error.

Thanks for your help anyways.

best,

M

----------

