How to disable application(s) using port 22
I'm trying to launch Ventrilo voice communication server using port 22 on my Red Hat 7.2 and I get an error:
ERROR: ServerCreateStream(): bind failed for interface '0.0.0.0'. I've red that this might be an issue of some other application using the same port. How can I check what application is using the port 22 and how can I disable it? I'm running linux in text mode. |
Port 22 is usually reserved for 'ssh' (encrypted telnet)
You can see if there is something running by telnetting to port 22: # telnet localhost 22 # telnet 127.0.0.1 22 If you get: telnet: Unable to connect to remote host: Connection refused then nothing is running on that port. But it seems your Ventrilo Whatever is not well configured, as it is trying to use IP 0.0.0.0 which means nothing. |
Ok, I got a response:
Connected to localhost Escape character is '^]'. SSH-1.99-OpenSSH_2.9p2 So there seems to be ssh-service running at it's default port 22. How do I disable this? |
you can disable your ssh but the port will still be reserved and most programs will refuse to use it. just use a high numbered port youll save yourself alot of trouble.
|
Only 'root' is allowed to bind an network-socket to a port below 1024. This is an security feature.
To see what you're running: netstat -anpA inet, or without the -n option to see hostnames and port names. If you run this as root, the -p option will tell you what program it is. If you really don't use SSH, you might want to turn it off completely. (with ssh you can login remotely, like telnet, and use a shell, transfer files, but over an encrypted connection) |
> just use a high numbered port youll save yourself alot of
> trouble. Well the problem is that I'm behind my ISP's firewall and they let me have only few ports open: http(80), ssh(22). So I'm not able to use high numbered ports. What I have to do is disable SSH-service and configure my Ventrilo so that it uses the port 22. I just don't know how to do it? |
to disable your SSH, probably you have to delete the link to the startup script from the runlevel directory.
I.e.: In my distro, the ssh startup script is: /etc/init.d/ssh and the link to make it active at boot time is: /etc/rc5.d/SXXssh (note XX is a number from 00 to 99, which determines the order for the startup. S20ssh would start before S40ssh) So, to disable SSHd from loading at startup, I just do: # rm /etc/rc5.d/SXXssh or # mv /etc/rc5.d/SXXssh /etc/rc5.d/sXXssh First you have to know which is your default runlevel (my case, 5 -->rc5.d) To get to know it, issue: # runlevel or # who -r |
Now it works, thank you soooo much! :)
|
All times are GMT -5. The time now is 09:44 AM. |