好好爱自己!

在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

posted @   立志做一个好的程序员  阅读(280)  评论(0编辑  收藏  举报
编辑推荐:
· AI与.NET技术实操系列:基于图像分类模型对图像进行分类
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
阅读排行:
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· 25岁的心里话
· ollama系列01:轻松3步本地部署deepseek,普通电脑可用
· 按钮权限的设计及实现
历史上的今天:
2015-08-07 在ubuntu 上创建 ssl 证书

不断学习创作,与自己快乐相处

点击右上角即可分享
微信分享提示