<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://www.jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://www.jackxiang.com/post//</link>
<title><![CDATA[vsftp实现不同用户不同权限[转] ]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[WEB2.0]]></category>
<pubDate>Tue, 10 Oct 2006 14:09:46 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	http://www.osyunwei.com/archives/9006.html<br/><br/>1。实现不同用户不同权限 <br/>现在我们就来实现三个用户的不同权限：a.upload用户，可以上传下载，可以新建文件夹，但不能删除文件和文件夹，不能重命名原有文件和文件夹；b.download用户，只能下载；c.admin用户，管理员，可以上传，可以下载，可以新建文件夹，可以删除和更改文件和文件夹名。这些用户都不能登录系统，并且用ftp连接时锁定在自己的家目录中不能进入系统文件夹。 <br/>a.cat &lt;logins.txt <br/>&gt;upload <br/>&gt;******* #upload用户的密码 <br/>&gt;download <br/>&gt;******* <br/>&gt;admin <br/>&gt;**************** <br/>&gt;! <br/>说明，此文本文件的格式是：单数行为用户名，偶数行为密码 <br/>b.db_load -T -t hash -f logins.txt /etc/vsftpd_login.db <br/>c.chmod 600 /etc/vsftpd_login.db <br/>d.呵呵(这步被vionna删除了) <br/>e.useradd -d /home/ftpsite virtual；chmod 700 /home/ftpsite;su - virtual -c &quot;echo hello&gt;/homt/ftpsite/test.file（建立虚拟用户所要访问的ftp目录并设置仅virtual用户访问的权限和创建一个供下载实验的文件） <br/>f.vi /etc/vsftpd.conf在此文件中插入下面的配置语句 <br/>guest_enable=YES（启用虚拟用户） <br/>guest_username=virtual（将虚拟用户映射为本地virtual用户） <br/>pam_service_name=vsftpd（指定PAM配置文件为在/etc/pam.d/下的vsftpd） <br/>user_config_dir=/etc/vsftpd_user_conf（指定不同虚拟用户配置文件的存放路径） <br/>保存退出 <br/>g.mkdir /etc/vsftpd_user_conf <br/>h.开放不同用户的不同权限　echo &quot;anon_world_readable_only=MO&quot;&gt;/etc/vsftpd_user_conf/download（开放download用户的下载权限——只能下载；注意这个不地方不要写成YES，否则将不能列出文件和目录） <br/>cp /etc/vsftpd_user_conf/download /etc/vsftpd_user_conf/upload <br/>vi /etc/vsftpd_user_conf/upload，添加下列行 <br/>write_enable=YES （增加写权限） <br/>anon_upload_enable=YES（增加上传权限） <br/>anon_mkdir_write_enable=YES (增加创建目录的权限） <br/>cp /etc/vsftpd_user_conf/upload /etc/vsftpd_user_conf/admin <br/>增加一行： <br/>anno_other_writer_enable=YES（增加管理员用户的删除/重命名的权限） <br/>i.测试 <br/>killall -9 vsftpd;/usr/local/sbin/vsftpd /etc/vsftpd.conf &amp; <br/>ftp 127.0.0.1 2121 <br/>以用户名download和你设置的密码登录，ls，可以看到文件，下载，成功！put一个文件，提示 <br/>Permission denied。rename test.file同样权限被拒绝；delete test.file同样不成功！ <br/>输入quit退出，以upload用户登录，OK！可以上传，下载，mkdir lsf，提示“/lsf&quot; created；rename lsf lsf1提示Permission denied,删除文件同样不成功！ <br/>输入quit退出，以admin用户登录，可以有上述所有权限，然后rmdir lsf,提示Remove directory oeration successful;delete test.file提示Delete operation successful!OK，大功告成了！ <br/><br/>附目 <br/>1.我的/etc/vsftpd.conf文件的内容 <br/>引用: <br/># Example config file /etc/vsftpd.conf <br/># <br/># The default compiled in settings are fairly paranoid. This sample file <br/># loosens things up a bit, to make the ftp daemon more usable. <br/># Please see vsftpd.conf.5 for all compiled in defaults. <br/># <br/># READ THIS: This example file is NOT an exhaustive list of vsftpd options. <br/># Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd&#039;s <br/># capabilities. <br/># <br/># Allow anonymous FTP? (Beware - allowed by default if you comment this out). <br/>anonymous_enable=NO <br/># <br/># Uncomment this to allow local users to log in. <br/>local_enable=YES <br/># <br/># Uncomment this to enable any form of FTP write command. <br/>write_enable=YES <br/># <br/># Default umask for local users is 077. You may wish to change this to 022, <br/># if your users expect that (022 is used by most other ftpd&#039;s) <br/>local_umask=022 <br/># <br/># Uncomment this to allow the anonymous FTP user to upload files. This only <br/># has an effect if the above global write enable is activated. Also, you will <br/># obviously need to create a directory writable by the FTP user. <br/>anon_upload_enable=NO <br/># <br/># Uncomment this if you want the anonymous FTP user to be able to create <br/># new directories. <br/>anon_mkdir_write_enable=NO <br/># <br/># Activate directory messages - messages given to remote users when they <br/># go into a certain directory. <br/>dirmessage_enable=YES <br/># <br/># Activate logging of uploads/downloads. <br/>xferlog_enable=YES <br/># <br/># Make sure PORT transfer connections originate from port 20 (ftp-data). <br/>connect_from_port_20=YES <br/># <br/># If you want, you can arrange for uploaded anonymous files to be owned by <br/># a different user. Note! Using &quot;root&quot; for uploaded files is not <br/># recommended! <br/>#chown_uploads=YES <br/>#chown_username=whoever <br/># <br/># You may override where the log file goes if you like. The default is shown <br/># below. <br/>#xferlog_file=/var/log/vsftpd.log <br/># <br/># If you want, you can have your log file in standard ftpd xferlog format <br/>#xferlog_std_format=YES <br/># <br/># You may change the default value for timing out an idle session. <br/>#idle_session_timeout=600 <br/># <br/># You may change the default value for timing out a data connection. <br/>#data_connection_timeout=120 <br/># <br/># It is recommended that you define on your system a unique user which the <br/># ftp server can use as a totally isolated and unprivileged user. <br/>#nopriv_user=ftpsecure <br/># <br/># Enable this and the server will recognise asynchronous ABOR requests. Not <br/># recommended for security (the code is non-trivial). Not enabling it, <br/># however, may confuse older FTP clients. <br/>#async_abor_enable=YES <br/># <br/># By default the server will pretend to allow ASCII mode but in fact ignore <br/># the request. Turn on the below options to have the server actually do ASCII <br/># mangling on files when in ASCII mode. <br/># Beware that turning on ascii_download_enable enables malicious remote parties <br/># to consume your I/O resources, by issuing the command &quot;SIZE /big/file&quot; in <br/># ASCII mode. <br/># These ASCII options are split into upload and download because you may wish <br/># to enable ASCII uploads (to prevent uploaded scripts etc. from breaking), <br/># without the DoS risk of SIZE and ASCII downloads. ASCII mangling should be <br/># on the client anyway.. <br/>ascii_upload_enable=YES <br/>ascii_download_enable=YES <br/># <br/># You may fully customise the login banner string: <br/>ftpd_banner=Welcome to Serv-U FTP serser. <br/># <br/># You may specify a file of disallowed anonymous e-mail addresses. Apparently <br/># useful for combatting certain DoS attacks. <br/>#deny_email_enable=YES <br/># (default follows) <br/>#banned_email_file=/etc/vsftpd.banned_emails <br/># <br/># You may specify an explicit list of local users to chroot() to their home <br/># directory. If chroot_local_user is YES, then this list becomes a list of <br/># users to NOT chroot(). <br/>chroot_list_enable=YES <br/># (default follows) <br/>chroot_list_file=/etc/vsftpd.chroot_list <br/># <br/># You may activate the &quot;-R&quot; option to the builtin ls. This is disabled by <br/># default to avoid remote users being able to cause excessive I/O on large <br/># sites. However, some broken FTP clients such as &quot;ncftp&quot; and &quot;mirror&quot; assume <br/># the presence of the &quot;-R&quot; option, so there is a strong case for enabling it. <br/>#ls_recurse_enable=YES <br/>chroot_local_user=YES <br/>listen_port=2121 <br/>listen=yes <br/>guest_enable=YES <br/>guest_username=virtual <br/>pasv_min_port=30000 <br/>pasv_max_port=30999 <br/>pam_service_name=vsftpd<br/>anon_world_readable_only=NO <br/>user_config_dir=/etc/vsftpd_user_conf <br/><br/><br/>2.我的/etc/vsftpd_user_conf/download的内容 <br/>引用: <br/>anon_world_readable_only=NO <br/><br/>3.我的/etc/vsftpd_user_conf/upload的内容 <br/>引用: <br/>anon_world_readable_only=NO <br/>write_enable=YES <br/>anon_upload_enable=YES <br/>anon_mkdir_write_enable=YES <br/><br/>4.我的/etc/vsftpd_user_conf/admin的内容 <br/>引用: <br/>anon_world_readable_only=NO <br/>write_enable=YES <br/>anon_upload_enable=YES <br/>anon_other_write_enable=YES <br/>anon_mkdir_write_enable=YES
]]>
</description>
</item><item>
<link>http://www.jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] vsftp实现不同用户不同权限[转] ]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>