引言
工作需要前端工程师在测试环境测试,但是前端工程师大多不用LINUX,调试起来我这种兼职运维的就是一个苦逼了,因此搭建一个FTP服务器方便前端工程师部署调试自己的代码
搭建proftpd服务器
安装proftpd
sudo apt-get install proftpd
配置proftpd
vim /etc/proftpd/proftpd.conf
# This is a basic ProFTPD configuration file (rename it to
# 'proftpd.conf' for actual use. It establishes a single server
# and a single anonymous login. It assumes that you have a user/group
# "nobody" and "ftp" for normal operation and anon.
ServerName "HAO GEEK TEAM"
ServerIdent on "Welcome To Hao Geek!"
ServerType standalone
DefaultAddress 192.168.1.***
SocketBindTight on
# Port 21 is the standard FTP port.
Port 21
# Umask 022 is a good standard umask to prevent new dirs and files
# from being group and world writable.
Umask 022
# To prevent DoS attacks, set the maximum number of child processes
# to 30. If you need to allow more than 30 concurrent connections
# at once, simply increase this value. Note that this ONLY works
# in standalone mode, in inetd mode you should use an inetd server
# that allows you to limit maximum number of processes per service
# (such as xinetd).
MaxInstances 30
# Set the user and group under which the server will run.
User www-data
Group www-data
# To cause every FTP user to be "jailed" (chrooted) into their home
# directory, uncomment this line.
DefaultRoot /srv/www/test/
AllowOverwrite yes
# Normally, we want files to be overwriteable.
<Directory /srv/www/test/test1>
<Limit WRITE>
AllowUser wangzhengyi
DenyAll
</Limit>
</Directory>
# 设置客户端认证方式,通过文件认证
AuthOrder mod_auth_file.c mod_auth_unix.c
# 指定文件认证的passwd文件
AuthUserFile /etc/proftpd/ftp.passwd
# 指定文件认证的group文件
AuthGroupFile /etc/proftpd/ftp.group
# 认证帐号不需要有有效的shell
RequireValidShell off
# 设置每秒接受的连接请求个数,防止DoS攻击
MaxConnectionRate 5
# 最大的连接上的client的数量
MaxClients 20 "Sorry,the maximum number of allowed users (%m) are already connected. "
# 允许端点续传
AllowStoreRestart on
#关闭dns反向解析
UseReverseDNS off
IdentLookups off
ftpasswd创建访问用户
sudo ftpasswd --passwd --file=/etc/proftpd/ftp.passwd --name=wangzhengyi --uid=33 --shell=/bin/false --home=/home/nohome
每个参数的定义可以man一下,如果你完全抄袭我的,那我只能说你运维做的太傻逼了,动动脑子想想自己的需求还是很必要的!
重启proftpd服务器
sudo /etc/init.d/proftpd restart
proftpd权限控制
目的
实现不同的用户不同的根目录
需求
目录结构如下:
--root(根目录):
--test1(子目录1)
--test2(子目录2)
--test3(子目录3)
有三个用户user1,user2,user3,user1默认到/root目录下,user1默认到/root/test1目录下,user2默认到/root/test2目录下
实现方法
(1)设置user1的home目录为/root,user1的home目录为/home/test1,user2的home目录为/home/test2,设置方法:
sudo ftpasswd --passwd --file=/etc/proftpd/ftp.passwd --name=wangzhengyi --uid=33 --shell=/bin/false --home=/root{ /test1 /test2}
(2)增加权限控制
DefaultRoot /root
<Directory /root/test1>
<Limit WRITE>
AllowUser user1
DenyAll
</Limit>
</Directory>
<Directory /root/test2>
<Limit WRITE>
AllowUser user2
DenyAll
</Limit>
</Directory>
原理
用户登录FTP服务器后,proftpd会默认首先寻找该系统用户的/home目录,并将该目录与proftpd.conf文件中的相关配置进行匹配,若无匹配,则转至proftpd.conf文件中的DefaultRoot命令登录服务器默认的根目录
参考链接
分享到:
相关推荐
proftpd1.2 linux下的ftp服务器软件,安装后可以用作ftp服务器使用,此服务器较为流行,安全性好,配置和apache的配置类似,只要更改相应的配置文件就可以进行配置
NULL 博文链接:https://lgcjava.iteye.com/blog/1992334
很久以前知道linux下搭建ftp服务器的软件是wuftp,现在真的时代变了,上网看一下几乎全世界的人都用proftpd了!赶个潮流,我也用proftpd在公司的一台备用小服务器上装上ftp服务器
proftpd服务工具,解压后进入proftpd目录,运行 sh init.sh...proftpd:进入proftpd目录,运行 sh start.sh 脚本,验证 FTP 是否 OK:通过浏览器输入 FTP 地址,输入账号密码测试是否 OK(FTP地址:ftp://ip地址:端口号)
proftpd 1.3.2 for linux complie ./configure make make install
proftpd 一键安装
ProFTP已经成为继Wu-FTP之后最为流行的FTP服务器软件,越来越多的站点选用它构筑安全高效的FTP站点,ProFTP配置方便,并有MySQL和Quota模块可供选择,利用它们的完美结合可以实现非系统账号的管理和用户磁盘的限制。...
centos7.9安装编proftpd,带配置文件,添加虚拟用户,配置用户目录权限
proftpd全称:Professional FTP daemon,是针对Wu-FTP的弱项而开发的,除了改进的安全性,还具备许多Wu-FTP没有的特点,能以Stand-alone、xinetd模式运行等。ProFTP已经成为继Wu-FTP之后最为流行的FTP服务器软件,...
CentOS下通过yum安装ProFTPd,建立虚拟用户库,启用虚拟用户登录过程记录
ProFTPD是一个Unix平台上或是类Unix平台上(如Linux, FreeBSD等)的FTP服务器程序,它是在自由软件基金会的版权声明(GPL)下开发、发布的免费软件,也就是说任何人只要遵守GPL版权声明,都可以随意修改源始码。...
proftpd是一款开放源码的ftp服务器软件,它是原来世界范围使用最广泛的wu-ftpd的改进版,它修正了wu-ftpd的许多缺陷,在许多方面进行了重大的改进,其中一个重要变化就是它学习了Apache 的配置方式,使proftpd的配置...
教会你怎么利用ProFtpd服务(FTP)
架设LINUX-FTP服务的压缩包proftpd,具体安装方式网上有
proftpd1.3.2.tar.bz2 proftpd1.3.2.tar.bz2 用于linux下建立ftp服务
提供Linux系统下proftp安装,配置。
proftpd支持mysql和quota配额
proftpd-1.3.7a.tar.gz安装包 。ftp服务器端程序。配置相比,vsftpd简单。 可用于linux下。