下面我们来介绍三种方法,让vsftpd开机的时候能自动运行,下面我们进行详细的说明。
1、使用chkconfig
[root@localhost ~]# chkconfig --level 35 vsftpd on
[root@localhost ~]# chkconfig --list | grep vsftpd
vsftpd 0:关闭 1:关闭 2:关闭 3:启用 4:关闭 5:启用 6:关闭
这样,vsftpd就在级别3和级别5上面运行啦!
2、修改/etc/rc.local文件,加入/etc/rc.d/init.d/vsftpd start这行。
[root@localhost ~]# vi /etc/rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
/etc/rc.d/init.d/vsftpd start
3、修改/etc/rc.local文件,加入/etc/rc.d/init.d/vsftpd start这行。
[root@localhost ~]# cat /etc/rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
/etc/rc.d/init.d/vsftpd start
以上三种方法的介绍,修改完成之后,重新启动服务器。
[root@localhost ~]# reboot
Broadcast message from root@localhost.localdomain
(/dev/pts/0) at 16:09 ...
The system is going down for reboot NOW!
重新查看vsftpd的运行状态
[root@localhost ~]# service vsftpd status
vsftpd (pid 1749) 正在运行...
系统显示vsftpd正在运行,至此已经实现vsftpd随linux系统自动启动服务啦!
另外再介绍两种图形化的设置方法
使用ntsysv命令
[root@localhost ~]# ntsysv
找到vsftpd,将前面选项中打“*”,然后确定即可。