ftp服务器安装-Linux-Ubuntu

FTP (File Transfer Protocol) is probably the most popular method of uploading files to a server; a wide array of FTP servers, such as vsftpd, and clients exist for every platform.
Pre-Flight Check
These instructions are intended specifically for installing the vsfptd on Ubuntu 14.04 LTS.
I’ll be working from a Liquid Web Core Managed Ubuntu 14.04 LTS server, and I’ll be logged in as root.

  • Step 1: Install vsftpd
    Warning: FTP data is insecure; traffic is not encrypted, and all transmissions are clear text (including usernames, passwords, commands, and data). Consider securing your FTP connection with SSL/TLS.
    First, you’ll follow a simple best practice: ensuring the list of available packages is up to date before installing anything new.

apt-get update

Then let’s install vsftpd and any required packages:

apt-get -y install vsftpd

vim /etc/vsftpd.conf

Disallow anonymous, unidentified users to access files via FTP; change the anonymous_enable setting to NO:

anonymous_enable=NO

Allow local uses to login by changing the local_enable setting to YES:

local_enable=YES

If you want local user to be able to write to a directory, then change the write_enable setting to YES:

write_enable=YES

Local users will be ‘chroot jailed’ and they will be denied access to any other part of the server; change the chroot_local_usersetting to YES:

chroot_local_user=YES

Exit and save the file with the command :wq.
Restart the vsftpd service:

service vsftpd restart

  • Step 3: Configure the User’s Home Directory
    With certain version of vsftpd you may receive the following error: 500 OOPS: vsftpd: refusing to run with writable root inside chroot().
    Not to worry! Create a new directory for the user receiving the error (user2 in this case) that is a subdirectory of their home directory (/home/user2). For example:
    Fix permissions for user2‘s home directory:

chmod a-w /home/user2/

Make a new directory for uploading files:

mkdir /home/user2/files
chown user2:user2 /home/user2/files/

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • ftp 文件传输协议 跨平台 上传下载文件 vsftpd 工具:非常安全的文件传输协议;默认的命令端口21号,数据...
    柒夏锦阅读 4,076评论 1 9
  • 1 概述 工作中,需要搭建ftp服务器来实现资源的共享。本文将通过脚本实现自动化安装ftp服务器,并进行相关配置,...
    ghbsunny阅读 3,115评论 0 2
  • #################匿名权限控制############### anonymous_enable=Y...
    牧民阅读 4,571评论 2 4
  • FTP服务概述 简单FTP构建及访问 VSFTP服务基础 用户禁锢、黑白名单 FTP并发及带宽限制 一、FTP服务...
    紫_轩阅读 7,672评论 3 25
  • 这是一个错觉 我被放逐到边界 不让我歌唱 唱些什么?我不知道 我写诗写到天亮 只是头脑昏恍 汲取龙头里的甘霖 喝到...
    秦北山阅读 416评论 0 0