Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to shutdown ssh and telnet port

Status
Not open for further replies.

peac3

Technical User
Jan 17, 2009
226
AU
Hi guys,

I would like to /close the ssh and telnet port, so no one can jump in to this box, this box only be able to receive the file.

I think I have many options to do this :
- shutdown the service
- edit iptables configuration file by putting hash at the beginning.

Just wondering what you guys usually do?

Thanks in advance,
 
Shutting down the service is the simplest solution.

How is the box receiving the file? If it's through scp or sftp then stoppign ssh will stop those as well (they use the same port).

Annihilannic.
 
ftp.. scp and sftp using the same port.
 
I don't really understand your response. FTP uses ports 20 and 21. SCP, SFTP and SSH all use port 22 (so you can't turn off the SSH service, it's required by all three). Telnet uses port 23, so you can safely disable the telnet service. Do you know how to do that? What flavour of Unix are you using?

Annihilannic.
 
Hi Anni,

Sorry If I'm confusing you...

You ask : How is the box receiving the file?
so I said : ftp

our ftp uses port 21.

so we would like to close the ssh port, telnet, etc... so that box only do receiving files via ftp and no one can jump in to the box as this is prod box..

The box is fedora 10.

Thanks alot.
 
Okay, all clear now. :) service sshd stop will stop the currently running SSH service. chkconfig sshd off will prevent it from starting at the next reboot. Telnet is usually serviced by the inetd (which you would not normally stop), but you can turn off that facility using chkconfig as well. Try chkconfig --list | grep telnet to see what the service is called and whether it is already switched off.

Are you sure you want to turn off SSH? How do you administrate your server, by physically logging in to it (i.e. standing in front of it, not across the network)? If you still want to use SSH, you might consider setting up an iptables rule to only allow connections to port 21 from your own network.

Annihilannic.
 
If you still want to use SSH, you might consider setting up an iptables rule to only allow connections to port 21 from your own network.

That's exactly what I want.. I prefer to stop it via iptables rather than permanently switch off the service, can you pls let me know how?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top