[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: easiest way to shut down all network services besides ssh?





Le 18.12.2014 06:08, Britton Kerin a écrit :
I have a system that I would like to make accessible only by ssh.

No apache telnet ftp anything else.

What is the easiest way to achieve this?  It came from a vendor with
a slew of package of all sorts, so I don't even know everything that
I want to remove.

Thanks,
Britton

Reinstalling a clean system is probably the easier solution.
But, if you can't do that, then you can list all running services (if and only if they support sysvinit tools) with this command:
# service --status-all 2>/dev/null |grep +|cut -f2 -d ']'

Then, just stop services manually, or build a script which stops everything except the few services you want to keep alive.
And if you want to have this disabling permanent, then:

$ less /etc/rc$(/sbin/runlevel |cut -f 2 -d' ').d/README

will give you pointers about how to do that.
It is also possible that things starts with cron, so you should probably check into /etc/ and /var/spool/cron/ everything included in cron's directories.


Reply to: