本地filezilla&servervsftp搭配使用


环境:本地ubuntu系统&serverubuntu系统

本地安装filezilla 

apt-get install filezilla '安装filezilla
filezilla ‘执行

server安装vsftp 參照 阿里云安装vsftp

apt-get install vsftpd -y   ’安装vsftp

加入ftp帐号和文件夹

先检查一下nologin的位置,通常在/usr/sbin/nologin或者/sbin/nologin下。

使用以下的命令创建帐户,该命令指定了/alidata/www/wwwroot为用户pwftp的家文件夹,您能够自定义帐户名和文件夹


useradd -d /alidata/www/wwwroot -s /sbin/nologin test  ‘加入ftp帐号,加粗为虚拟文件夹,如果账户为test

改动该帐户password:

passwd pwftp   ’创建password
123456 ’如果为password
 
  
将配置文件里”anonymous_enable=YES “改为 “anonymous_enable=NO”
取消例如以下配置前的凝视符号:
local_enable=YES
write_enable=YES
chroot_local_user=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list

保存退出


编辑/etc/vsftpd.chroot_list文件,将ftp的帐户名加入进去。保存退出

vi /etc/vsftpd.chroot_list  '此文件默认是没有的,新创建的
 test 123456 '直接将账户和password放入   

改动shell配置,vi编辑/etc/shells。假设该文件中没有/usr/sbin/nologin或者/sbin/nologin(详细看当前系统配置)则追加进去

vi /etc/shells
/usr/sbin/nologin ‘直接加入进去


重新启动vsftp服务并測试登录

service vsftpd restart

本地用filezilla登录ftp。报错

500 OOPS: could not read chroot() list file:/etc/vsftpd.chroot_list
Error:    Critical error
Error:    Could not connect to server</span>

解决:

chmod a-w /alidata/www/wwwroot   ‘去除根文件夹的写权限

又一次登录,登录成功,可看到文件。





转载于:https://www.cnblogs.com/liguangsunls/p/7265762.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值