温馨提示×

Debian系统vsftp的自动启动设置

小樊
35
2025-03-04 20:41:10
栏目: 智能运维
Debian服务器限时活动,0元免费领,库存有限,领完即止! 点击查看>>

在Debian系统上设置vsftpd的自动启动可以通过以下几种方法实现:

使用rc.local文件

  1. 打开终端。
  2. 编辑 /etc/rc.local 文件:
    sudo nano /etc/rc.local
    
  3. exit 0 之前添加以下行:
    /usr/sbin/vsftpd
    
  4. 保存并退出编辑器。
  5. 使 rc.local 文件可执行:
    sudo chmod +x /etc/rc.local
    

使用systemd服务

  1. 打开终端。
  2. 创建一个新的systemd服务文件:
    sudo nano /etc/systemd/system/vsftpd.service
    
  3. 在文件中添加以下内容:
    [Unit]
    Description=Very Secure FTP Daemon
    After=network.target
    
    [Service]
    WorkingDirectory=/etc/vsftpd
    ExecStart=/usr/sbin/vsftpd -D
    Restart=always
    StandardOutput=syslog
    StandardError=syslog
    
    [Install]
    WantedBy=multi-user.target
    
  4. 保存并退出编辑器。
  5. 启用并启动vsftpd服务:
    sudo systemctl enable vsftpd.service
    sudo systemctl start vsftpd.service
    
  6. 检查服务状态以确认vsftpd是否正在运行:
    sudo systemctl status vsftpd.service
    

亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>

推荐阅读:debian系统vsftp的自动化脚本

0