LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to disable application(s) using port 22 (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-disable-application-s-using-port-22-a-94798/)

Johnnyboy 09-20-2003 07:39 AM

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.

pablob 09-20-2003 08:07 AM

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.

Johnnyboy 09-20-2003 09:01 AM

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?

SCVirus 09-20-2003 02:23 PM

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.

yapp 09-20-2003 05:20 PM

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)

Johnnyboy 09-21-2003 02:08 AM

> 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?

pablob 09-21-2003 06:05 AM

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

Johnnyboy 09-21-2003 10:18 AM

Now it works, thank you soooo much! :)


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