zoukankan      html  css  js  c++  java
  • 在Ubuntu 14.04 上安装 FTP 服务

      1. sudo apt-get update

      2. sudo apt-get install vsftpd

      3. adduser sammy

    Assign a password when prompted and feel free to press "ENTER" through the other prompts.

    FTP is generally more secure when users are restricted to a specific directory.vsftpd accomplishes this with chroot jails. When chroot is enabled for local users, they are restricted to their home directory by default. However, because of the way vsftpd secures the directory, it must not be writable by the user. This is fine for a new user who should only connect via FTP, but an existing user may need to write to their home folder if they also shell access.

    In this example, rather than removing write privileges from the home directory, we're will create an ftpdirectory to serve as the chroot and a writable files directory to hold the actual files.

    Create the ftp folder, set its ownership, and be sure to remove write permissions with the following commands:

    • sudo mkdir /home/sammy/ftp
    • sudo chown nobody:nogroup /home/sammy/ftp
    • sudo chmod a-w /home/sammy/ftp

    除了途中两处外,还有一处: ,   不加这句的话,在ftp客户端不能重命名文件或文件夹。

    重启vsftpd   service vsftpd restart

    在Ubuntu 14.04 上安装 FTP 服务

    第一步>>更新库

    linuxidc@linuxidc:~$ sudo apt-get update

    第二步>>采用如下命令安装VSFTPD的包

    linuxidc@linuxidc:~$ sudo apt-get install vsftpd

    第三步>>安装完成后打开 /etc/vsftpd.conf 文件,按如下所述修改。

    取消如下行的注释(行号为29和33)

    write_enable=YES
    local_umask=022

    >> 取消如下行的注释(行号120)来阻止除了用户文件夹意外的文件夹。

    chroot_local_user=YES

    在文件最后增加如下一行:

    allow_writeable_chroot=YES

  • 相关阅读:
    leetCode 53. maximum subarray
    leetcode strStr()
    DCNN models
    1*1 的卷积核
    leetcode 14. longest common prefix
    springMVC接受json并打开新页面
    jsp取addFlashAttribute值深入理解即springMVC发redirect传隐藏参数
    hive安装教程本地模式
    poi excel超出65536行数限制自动扩展Invalid row number (65536) outside allow
    java 构造json对象数组
  • 原文地址:https://www.cnblogs.com/oxspirt/p/7299960.html
Copyright © 2011-2022 走看看