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!

closing ftp service in evening

Status
Not open for further replies.

absi

MIS
Sep 2, 2000
67
GB
Dear All,
Is there anyway to shutdown ftp service in evening...
i dont want to stop ftpd deamon for this purpose...
but want to close the 21 port used by the ftpd deamon!!
how i can do that.....
Absi
 
Try editing the /etc/services and commenting out the line for ftp/21. Then refresh inetd. This should keep the system from listening on port 21. Also, you could use /etc/inetd.conf to filter out the ftp traffic from all hosts during the time frame you are looking for.


crowe
 
If you are running ws-ftp it's pretty easy, just add the following line to your /etc/ftpaccess file:

shutdown /etc/shutmsg

You can create the /etc/shutmsg file with a custom message in it to suit you.

Else, as crowe said, either comment the port out in the /etc/services file, ot comment the process out in the /inetd.conf file. This will require a SIGHUP of the inetd process to make effective.
 
dears
can anybody tell me a simple script to comment out
ftpd line automatically....i will run it by crontab!
Absi
 
Absi,

Te scripts below will achieve what you want:

#!/bin/ksh
#
# Comment out ftp from /etc/inetd.conf
/usr/sbin/chsubserver -r inetd -C /etc/inetd.conf -d -v 'ftp' -p 'tcp6'
refresh -s inetd

#!/bin/ksh
#
# Comment in ftp from /etc/inetd/conf
/usr/sbin/chsubserver -r inetd -C /etc/inetd.conf -a -v 'ftp' -p 'tcp6'
refresh -s inetd

Execute them via cron and voila.

Hope that helps PSD
IBM Certified Specialist - AIX V4.3 Systems Support
IBM Certified Specialist - AIX V4 HACMP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top