No1Lives4Ever
No1Lives4Ever

Reputation: 6893

SSH port forwarding: bind: Address already in use

I have a remote server which I want to ssh it and forward my local port into it.

My application is hosting port 443 on my local machine. I'm connecting to the server with gcloud. This is the command:

gcloud compute --project "**^" ssh --zone "***" "***"

The target is to allow other to communicate, on port 9000, with the server and this traffic will redirected into my local machine, on port 443. On other words, accessing server on port 9000 is equal to access my computer on port 443.

So I do ssh port forwarding

gcloud compute --project "**^" ssh --zone "***" "***" -- -L 443:127.0.0.1:9000 -N

and get back this error:

bind: Address already in use
channel_setup_fwd_listener_tcpip: cannot listen to port: 443
Could not request local forwarding.

What I'm doing wrong?

Upvotes: 1

Views: 20337

Answers (2)

Mohammad reza Ayubi
Mohammad reza Ayubi

Reputation: 151

linux

if you have no other ssh connection you can fix it with :

killall ssh

Upvotes: 0

Krepver
Krepver

Reputation: 66

The correct option is -R

... -R 9000:localhost:443

Upvotes: 5

Related Questions