Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Want my Firefox could use localhost:9099 proxy forwarded from vps server, why it doesn't it work this way? I always get bind: Address already in use

$ ssh -vfND 127.0.0.2:9099 vpn 
OpenSSH_5.9p1, OpenSSL 1.0.0j-fips 10 May 2012
debug1: Connection established.
debug1: Host  is known and matches the RSA host key.
debug1: Next authentication method: publickey
debug1: Authentication succeeded (publickey).
debug1: Local connections to 127.0.0.2:9099 forwarded to remote address socks:0
debug1: Local forwarding listening on 127.0.0.2 port 9099.
bind: Address already in use
channel_setup_fwd_listener: cannot listen to port: 9099
debug1: Local connections to 127.1:8080 forwarded to remote address socks:0
debug1: Local forwarding listening on 127.0.0.1 port 8080.
debug1: channel 0: new [port listener]
debug1: Requesting no-more-sessions@openssh.com
debug1: forking to background

I add the next step in my solution of problem. The duplicate binding is solved it was a question of firewall on local machine now i can get connected to my vps server. But proxy in browser still doesn't work when i open a http in browser i get

The connection was reset The connection to the server was reset while the page was loading. If your computer or network is protected by a firewall or proxy, make sure  that Firefox is permitted to access the Web.

and on remote machine (VPS) i get the next

debug1: Connection to port 9099 forwarding to socks port 0 requested.
debug2: fd 6 setting TCP_NODELAY
debug2: fd 6 setting O_NONBLOCK
debug1: channel 2: new [dynamic-tcpip]
debug2: channel 2: pre_dynamic: have 0
debug2: channel 2: pre_dynamic: have 837
debug2: channel 2: zombie
debug2: channel 2: garbage collecting
debug1: channel 2: free: dynamic-tcpip, nchannels 3

on remote machine

# iptables -L -n -v

       state NEW tcp dpt:9099
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0              122 19030 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            reject-with icmp-host-prohibited

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            reject-with icmp-host-prohibited

netstat -lntp

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:17500           0.0.0.0:*               LISTEN      1283/dropbox        
tcp        0      0 0.0.0.0:55964           0.0.0.0:*               LISTEN      848/rpc.statd       
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      837/rpcbind         
tcp        0      0 127.0.0.1:8080          0.0.0.0:*               LISTEN      5750/ssh            
tcp        0      0 127.0.0.1:9099          0.0.0.0:*               LISTEN      5750/ssh            
tcp        0      0 0.0.0.0:46165           0.0.0.0:*               LISTEN      1568/skype          
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      853/cupsd           
tcp6       0      0 :::445                  :::*                    LISTEN      
share|improve this question
1  
The TCP / IP stack does not allow two processes to listen on the same socket (port + host IP). The message is telling you some other process already has localhost:9099 so ssh can't have it. You can use a different port or find and kill the other process. –  jw013 Jan 24 '13 at 16:15
    
Ok, no matter which port i try to use i give the same error –  Yurij73 Jan 24 '13 at 16:25
    
Do you really have processes listening on every single port? –  jw013 Jan 24 '13 at 16:27
2  
what output is produced by 'netstat -lntp'? –  Serge Jan 24 '13 at 18:44
    
local ssh daemon listen tcp 0 0 0.0.0.0:9099 0.0.0.0:* LISTEN 4779/ssh –  Yurij73 Jan 24 '13 at 21:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.