用Linux构建高效FTP服务器(4)

来源:Asp之家 时间:2010-08-23 19:05:00 

7.重新启动VSFTP

#service vsftpd restart

8.以虚拟用户gou(Linux中并无该账号)进行测试:

# ftp 127.0.0.1

Connected to 127.0.0.1 (127.0.0.1)。

220 Welcom to my FTP server.

Name (127.0.0.1:root): gou

331 Please specify the password.

Password:

230 Login successful. Have fun.

Remote system type is UNIX.

Using binary mode to transfer files.

测试下载服务器目录中的一个文件mytest:

ftp》 get mytest

local: mytest remote: mytest

227 Entering Passive Mode (127,0,0,1,159,19)

150 Opening BINARY mode data connection for mytest (21 bytes)。

226 File send OK.

21 bytes received in 0.00038 secs (54 Kbytes/sec)

测试上传本机目录中的文件vsftpd.conf:

ftp》 !ls

account.db chroot_list k mytest userconf vsftpd.conf

ftp》 put vsftpd.conf

local: vsftpd.conf remote: vsftpd.conf

227 Entering Passive Mode (127,0,0,1,117,203)

150 Ok to send data.

226 File receive OK.

4229 bytes sent in 0.00195 secs (2.1e+03 Kbytes/sec)

可以看到,使用没有系统账号的虚拟用户可以成功完成上传、下载的工作。但该FTP虚拟服务器只允许虚拟用户登录,其它系统用户无法登录,如系统用户user1不是虚拟用户,则不能登录该虚拟服务器。

# ftp 127.0.0.1

Connected to 127.0.0.1 (127.0.0.1)。

220 Welcom to my FTP server.

Name (127.0.0.1:root): user1

331 Please specify the password.

Password:

530 Login incorrect.

Login failed.

在虚拟FTP服务器中,也可以对各个用户的权限进行设置。方法是在/etc/vsftpd.conf文件中添加如下一行:

user_config_dir=用户配置文件目录

然后在用户配置文件目录下创建相应的用户配置文件,比如为上述名为gou的用户创建一个配置文件(假设配置文件目录为/etc/user_config_dir):

#vi /etc/user_config_dir/gou

write_enable=NO

anono_upload_enable=NO

重启FTP服务器,这时再使用账号gou来登录,就已经没有上传的权限

标签:服务器,FTP,Linux
0
投稿

猜你喜欢

  • 新网站被google,百度收录的小技巧

    2009-08-11 14:44:00
  • Discuz! 7.0到Discuz! 7.1升级图文教程

    2009-10-23 18:01:00
  • 如何选择免费虚拟主机及其五点注意事项

    2008-11-27 10:24:00
  • 两招填补Windows 2003 DNS服务器漏洞

    2010-02-20 19:25:00
  • 从驱动中国100万元收购qudong.com谈全拼域名的优势

    2007-08-05 13:30:00
  • 支付宝已获外管局批准 人民币可直购国外货物

    2009-10-27 13:59:00
  • 淘宝客15天记录 日赚50 分享一点新手经验

    2010-05-10 14:00:00
  • 中小网站如何能从广告联盟获取到更多利益

    2008-12-26 13:19:00
  • 铸就形象品牌 对中国企业博客营销的思考

    2009-03-02 10:29:00
  • 八个技巧提高Google Adsense收入

    2009-04-22 15:49:00
  • Facebook创始人成全球最年轻亿万富翁

    2008-01-16 18:53:00
  • 堵塞Web漏洞(中)

    2007-10-22 13:43:00
  • 我国网民数达2.21亿人超美国居全球首位

    2008-04-24 14:14:00
  • 网管员需要注意十点安全技巧

    2009-09-16 20:29:00
  • 用用户的眼睛来优化图片搜索

    2007-11-08 11:51:00
  • 从零开始配置服务器

    2010-08-26 18:31:00
  • 搭建Linux安全的Squid代理服务器

    2010-03-29 19:07:00
  • 中国网游山寨化严重:新游戏3天就被山寨

    2009-10-23 07:48:00
  • V5Shop联盟系统第三方嵌入式整合接口开通

    2009-11-19 07:53:00
  • Godaddy中FTP使用的问题

    2010-04-17 13:15:00
  • asp之家 网站运营 m.aspxhome.com