Start / Stop FTP server on FreeBSD / OpenBSD

本文详细介绍了在BSD系统中禁用和重新启用FTP服务的方法,包括编辑/etc/inetd.conf文件来注释FTP服务,以及重启inetd服务以应用更改。同时提供了在系统启动时禁用FTP服务的步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

ftpd is the Internet File Transfer Protocol server under BSD and configured via inetd. The ftpd utility is the Internet File Transfer Protocol server process. The server uses the TCP protocol and listens at the port specified or by default at port 21.

The inetd server should be run at boot time by /etc/rc. It then listens for connections on certain internet sockets. When a connection is found on one of its sockets, it decides what service the socket corresponds to, and invokes a program to service the request. The server program is invoked with the service socket as its standard input, output and error descriptors. After the program is finished, inetd continues to listen on the socket.
Task: Disable FTPD

Login as root user.

To disable ftpd open /etc/inetd.conf file:
# vi /etc/inetd.conf

Find line:
ftp stream tcp nowait root /usr/libexec/ftpd ftpd -l

To disable a service, comment it out by prefixing the line with '#'.
#ftp stream tcp nowait root /usr/libexec/ftpd ftpd -l

Save and close the file.
Task: Restart inetd

Now just restart inetd, enter:
# /etc/rc.d/inetd restart

OR if you are using OpenBSD:
# kill -HUP `cat /var/run/inetd.pid`

To enable ftp, reverse the step # 1.


From: http://www.cyberciti.biz/faq/star-stop-bsd-ftp-service/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值