LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   VNC with SSH - won't release the port (https://www.linuxquestions.org/questions/linux-networking-3/vnc-with-ssh-wont-release-the-port-354959/)

greauxe 08-19-2005 02:52 PM

VNC with SSH - won't release the port
 
Using Fedora 4. I issued the command "ssh -g -L 5901:localhost:5902 mydomain.com" to enable secure vnc connection.

Now I killed the vnc connection, to restart for another user, but the port won't release! I killed the PID of ssh, sshd, xinetd, vnc, etc. When I try to reissue the command, I get "bind: Address already in use".

I also deleted the .X11, etc lock files, and the lock files under ~.vnc/.

I tried rebooting also, still get same problem.

Is there a way to tel bind to release the port?

Help!

david_ross 08-19-2005 03:02 PM

Can you post the output from:
netstat -nlp

greauxe 08-19-2005 04:38 PM

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:2401 0.0.0.0:* LISTEN 3110/xinetd
tcp 0 0 0.0.0.0:32769 0.0.0.0:* LISTEN 1805/rpc.statd
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 2296/mysqld
tcp 0 0 0.0.0.0:139 0.0.0.0:* LISTEN 2434/smbd
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1787/portmap
tcp 0 0 0.0.0.0:10000 0.0.0.0:* LISTEN 2524/perl
tcp 0 0 0.0.0.0:5555 0.0.0.0:* LISTEN 2393/dc_server
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 2118/cupsd
tcp 0 0 127.0.0.1:5335 0.0.0.0:* LISTEN 2100/mDNSResponder
tcp 0 0 0.0.0.0:90 0.0.0.0:* LISTEN 2660/httpd
tcp 0 0 0.0.0.0:26 0.0.0.0:* LISTEN 2338/sendmail: acce
tcp 0 0 0.0.0.0:7741 0.0.0.0:* LISTEN 2445/lisa
tcp 0 0 0.0.0.0:445 0.0.0.0:* LISTEN 2434/smbd
tcp 0 0 :::993 :::* LISTEN 2320/dovecot
tcp 0 0 :::995 :::* LISTEN 2320/dovecot
tcp 0 0 :::5901 :::* LISTEN 5575/ssh
tcp 0 0 :::110 :::* LISTEN 2320/dovecot
tcp 0 0 :::143 :::* LISTEN 2320/dovecot
tcp 0 0 :::80 :::* LISTEN 2361/httpd
tcp 0 0 :::22 :::* LISTEN 3627/sshd
tcp 0 0 :::443 :::* LISTEN 2361/httpd
udp 0 0 0.0.0.0:32768 0.0.0.0:* 1805/rpc.statd
udp 0 0 192.168.0.3:137 0.0.0.0:* 2437/nmbd
udp 0 0 0.0.0.0:137 0.0.0.0:* 2437/nmbd
udp 0 0 192.168.0.3:138 0.0.0.0:* 2437/nmbd
udp 0 0 0.0.0.0:138 0.0.0.0:* 2437/nmbd
udp 0 0 0.0.0.0:10000 0.0.0.0:* 2524/perl
udp 0 0 0.0.0.0:7741 0.0.0.0:* 2445/lisa
udp 0 0 0.0.0.0:68 0.0.0.0:* 1736/dhclient
udp 0 0 0.0.0.0:709 0.0.0.0:* 1805/rpc.statd
udp 0 0 0.0.0.0:5353 0.0.0.0:* 2100/mDNSResponder
udp 0 0 0.0.0.0:111 0.0.0.0:* 1787/portmap
udp 0 0 0.0.0.0:631 0.0.0.0:* 2118/cupsd
raw 1296 0 0.0.0.0:1 0.0.0.0:* 7 2445/lisa
Active UNIX domain sockets (only servers)
Proto RefCnt Flags Type State I-Node PID/Program name Path
unix 2 [ ACC ] STREAM LISTENING 6924 2479/hald @/tmp/hald-local/dbus-HsrSPPb9gm
unix 2 [ ACC ] STREAM LISTENING 6138 2109/acpid /var/run/acpid.socket
unix 2 [ ACC ] STREAM LISTENING 6712 2377/dc_client /var/cache/mod_ssl/distcache
unix 2 [ ACC ] STREAM LISTENING 6814 2426/xfs /tmp/.font-unix/fs7100
unix 2 [ ACC ] STREAM LISTENING 6576 2320/dovecot /var/run/dovecot-login/default
unix 2 [ ACC ] STREAM LISTENING 6902 2468/dbus-daemon /var/run/dbus/system_bus_socket
unix 2 [ ACC ] STREAM LISTENING 6461 2296/mysqld /var/lib/mysql/mysql.sock

david_ross 08-20-2005 07:19 AM

It looks like the port is still in use - try killing the ssh process:
kill -9 5575

Then start the forwarding process again.

greauxe 08-20-2005 02:42 PM

Nope. I tried that already. I killed the process, ensured it died, saw no indication anywhere that ssh is running (ps -A; netstat -nlp, etc) and as soon as I try the command again, it tells me the port is not available.

OH, also, I can start vncserver normally, without specifying a port, and it will give start with port :1 with np; but not through ssh.

This is a tricky one. may be a bug.

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


All times are GMT -5. The time now is 09:58 AM.