LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices

Reply
 
Search this Thread
Old 03-16-2004, 10:52 AM   #1
Linux~Powered
Member
 
Registered: Jan 2004
Location: /lost+found
Distribution: Slack`er-current
Posts: 845

Rep: Reputation: 31
How do you close port 22 SSH?


I'm trying to secure my box and so far i've shut down ports in /etc/rc.inet1.conf that i don't use. When i run nmap it says port 22 ssh is open. How do i close this port other than a firewall rule? I looked in the /etc/rc.d directory, but can't figure out how you shut it off. I googled and read that it is to be disabled in /etc/rc.config, but i don't have an rc.config. I have a rc.inetd1.conf where i commented out the other ports i have no use for, but ssh isn't in there. There is a rc.sshd, but i don't see an option to disable it there either.
 
Old 03-16-2004, 10:56 AM   #2
darkCanuck
Member
 
Registered: Mar 2004
Location: Edmonton, Alberta, Canada
Distribution: FreeBSD 4.10 RELEASE
Posts: 40

Rep: Reputation: 15
Why not just turn off sshd?
 
Old 03-16-2004, 11:02 AM   #3
Linux~Powered
Member
 
Registered: Jan 2004
Location: /lost+found
Distribution: Slack`er-current
Posts: 845

Original Poster
Rep: Reputation: 31
That's what i am trying to do! How do i do that?
 
Old 03-16-2004, 11:07 AM   #4
darkCanuck
Member
 
Registered: Mar 2004
Location: Edmonton, Alberta, Canada
Distribution: FreeBSD 4.10 RELEASE
Posts: 40

Rep: Reputation: 15
Do you have a service configuration utility that comes with Slackware? (I'm not familiar with it.) It would be in the main menu under configuration/system settings or the like.

Or check /etc/services (if you have that file). Do a search for ssh and just put a # before that line. Reboot and that should do it. If you don't have that file, just look in /etc for something like serv*
 
Old 03-16-2004, 11:29 AM   #5
Linux~Powered
Member
 
Registered: Jan 2004
Location: /lost+found
Distribution: Slack`er-current
Posts: 845

Original Poster
Rep: Reputation: 31
I have a /etc/service file and commented out the ssh line, rebooted, but tcp port 22 is still open.

ftp 21/tcp #File Transfer [Control]
ftp 21/udp #File Transfer [Control]
#ssh 22/tcp #Secure Shell Login
ssh 22/udp #Secure Shell Login
telnet 23/tcp
telnet 23/udp
 
Old 03-16-2004, 01:45 PM   #6
darkCanuck
Member
 
Registered: Mar 2004
Location: Edmonton, Alberta, Canada
Distribution: FreeBSD 4.10 RELEASE
Posts: 40

Rep: Reputation: 15
Did you try commenting out the UDP below it, as well?
 
Old 03-16-2004, 01:52 PM   #7
benjithegreat98
Senior Member
 
Registered: Dec 2003
Location: Shelbyville, TN, USA
Distribution: Fedora Core, CentOS
Posts: 1,019

Rep: Reputation: 45
To permanently end sshd
Code:
/etc/rc.d/rc.sshd stop
chmod -x /etc/rc.d/rc.sshd
The first command ends it and the 2nd command sets the initialization file as not executable. When you reboot, sshd will not start.
 
Old 03-16-2004, 11:13 PM   #8
Linux~Powered
Member
 
Registered: Jan 2004
Location: /lost+found
Distribution: Slack`er-current
Posts: 845

Original Poster
Rep: Reputation: 31
Cool! The /etc/rc.d/rc.sshd stop & chmod -x /etc/rc.d/rc.sshd commands worked. Thanks
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Which port should I close? schneemann Linux - Networking 5 11-15-2005 03:15 AM
close a port mfrangos79 Linux - Security 7 11-03-2005 01:32 AM
what happens if I close ssh terminal ? juanb Linux - General 1 09-17-2004 05:15 PM
cant get port 21 to close crosswire Linux - Newbie 4 09-14-2004 06:17 PM
Close ssh for all except one IP krilen Linux - Security 13 03-26-2004 05:07 PM


All times are GMT -5. The time now is 05:41 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration