最新消息:

工具第3款:vsftp安装及修改配置

基本工具 杨红伟 3968浏览 0评论

网上说到的这方面的内容可以说是真的很多,但是很多都是错误的,都是在诱导人的,所以我为此写了一篇这样的文章。

一:安装vsftp

sudo apt-get install vsftpd

二:修改vsftpd的配置(十分重要)

vim /etc/vsftpd.conf

将chroot_local_user=yes的注释去掉,否则会将根目录暴露

三:增加用户

useradd -d /alidata/www/test testuser 

注释:增加用户testuser,并制定testuser用户的主目录为/alidata/www/test

passwd testuser //为testuser设置密码

四:更改目录权限(十分重要)

chmod a+w /alidata/www/test

注:否则会报错 500 OOPS: vsftpd: refusing to run with writable root inside chroot ()错误的解决方法,这是vsftpd更新后增加安全性的操作。
如果将目录改为777,还会报这个错误。这里是加号,不是减号!!!!

五:删除用户列表(可选)

userdel testuser

六:限制用户列表(可选)

vim /etc/vsftpd.conf查看

chroot_list_file=/etc/vsftpd.chroot_list

注:网上说的这个文件修改,没必要

vim /etc/vsftpd.chroot_list

将限制的用户加上,每行一个,这样就可以禁止指定的用户访问用户列表

七:删除 vsftp

sudo apt-get remove vsftpd

八:重新启动 vsftp

sudo /etc/init.d/vsftpd restart
sudo /etc/init.d/vsftpd start
sudo /etc/init.d/vsftpd stop

总结:

其实很简单啦,只是可能版本不一样,导致人们有各种说法,再者配置文件内容太多,人们想的太多吧。其实前四步,第1步安装,用第2步到第4步就能把问题全部搞定!


Warning: Use of undefined constant PRC - assumed 'PRC' (this will throw an Error in a future version of PHP) in /www/wwwroot/www.ijquery.cn/wp-content/themes/d8-3.0/comments.php on line 17
发表我的评论
取消评论
表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址