<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>奔向远方 &#187; proftp</title>
	<atom:link href="http://www.tisswb.com/archives/tag/proftp/feed" rel="self" type="application/rss+xml" />
	<link>http://www.tisswb.com</link>
	<description>结婚开始倒计时了，高兴~</description>
	<lastBuildDate>Tue, 19 Jul 2011 09:30:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>ubuntu7.04安装并使用proftp</title>
		<link>http://www.tisswb.com/archives/8.html</link>
		<comments>http://www.tisswb.com/archives/8.html#comments</comments>
		<pubDate>Wed, 26 Mar 2008 16:33:08 +0000</pubDate>
		<dc:creator>笨二十一</dc:creator>
				<category><![CDATA[Linux/Unix]]></category>
		<category><![CDATA[服务器]]></category>
		<category><![CDATA[proftp]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.tisswb.cn/?p=8</guid>
		<description><![CDATA[这篇文章针对那些希望利用ftp协议和朋友们共享文件的人们,就像windows下的FTPserU,我提供的方式不是唯一的,希望我的方法足够清晰.这个FTPserver只允许拥有正确密码的人使用,所以你要明白只有已知的用户才能读取你的FTP服务.
1- 使用下面的命令安装proftpd:
Code:
sudo apt-get install proftpd
2- 在etc/shells 加入如下代码 (sudo gedit /etc/shells to open the file)(译注:命令行模式下sudo vi /etc/shells) :
Code:
/bin/false
新建一个 /home/FTP-shared 目录 :
Code:
cd /home
<span class="readmore"><a href="http://www.tisswb.com/archives/8.html" title="ubuntu7.04安装并使用proftp" target="_blank">阅读全文——共2828字</a></span>]]></description>
			<content:encoded><![CDATA[<p>这篇文章针对那些希望利用ftp协议和朋友们共享文件的人们,就像windows下的FTPserU,我提供的方式不是唯一的,希望我的方法足够清晰.这个FTPserver只允许拥有正确密码的人使用,所以你要明白只有已知的用户才能读取你的FTP服务.</p>
<p>1- 使用下面的命令安装proftpd:<br />
Code:<br />
sudo apt-get install proftpd<br />
2- 在etc/shells 加入如下代码 (sudo gedit /etc/shells to open the file)(译注:命令行模式下sudo vi /etc/shells) :<br />
Code:<br />
/bin/false<br />
新建一个 /home/FTP-shared 目录 :<br />
Code:<br />
cd /home<br />
sudo mkdir FTP-shared<br />
创建一个只能用来读取ftp的用户userftp. 这个用户不需要有效的shell(更安全) ,所以选择 /bin/false shell 给 userftp , /home/FTP-shared 作为主目录.<br />
为了是这部分更清楚,我给取此操作的命令行:<br />
Code:<br />
sudo useradd userftp -p your_password -d /home/FTP-shared -s /bin/false<br />
在FTP-shared 目录下新建一个download和一个upload 目录:<br />
Code:<br />
cd /home/FTP-shared/<br />
sudo mkdir download<br />
sudo mkdir upload<br />
现在我们来给它们设置相应的权限:<br />
Code:<br />
cd /home<br />
sudo chmod 755 FTP-shared<br />
cd FTP-shared<br />
sudo chmod 755 download<br />
sudo chmod 777 upload<br />
3- 好了,现在进入proftpd的配置文件:<br />
Code:<br />
sudo gedit /etc/proftpd/proftpd.conf //特别注意路径，网上以前给的是错的<br />
当然你可以按你的需要编辑你自己的proftpd.conf:<br />
Code:<br />
# To really apply changes reload proftpd after modifications.<br />
AllowOverwrite on<br />
AuthAliasOnly on</p>
<p># Choose here the user alias you want !!!!<br />
UserAlias sauron userftp</p>
<p>ServerName &#8220;ChezFrodon&#8221;<br />
ServerType standalone<br />
DeferWelcome on</p>
<p>MultilineRFC2228 on<br />
DefaultServer on<br />
ShowSymlinks off</p>
<p>TimeoutNoTransfer 600<br />
TimeoutStalled 100<br />
TimeoutIdle 2200</p>
<p>DisplayFirstChdir .message<br />
ListOptions &#8220;-l&#8221;</p>
<p>RequireValidShell off</p>
<p>TimeoutLogin 20</p>
<p>RootLogin off</p>
<p># It&#8217;s better for debug to create log files <img src='http://www.tisswb.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /><br />
ExtendedLog /var/log/ftp.log<br />
TransferLog /var/log/xferlog<br />
SystemLog /var/log/syslog.log</p>
<p>#DenyFilter *.*/</p>
<p># I don&#8217;t choose to use /etc/ftpusers file (set inside the users you want to ban, not useful for me)<br />
UseFtpUsers off</p>
<p># Allow to restart a download<br />
AllowStoreRestart on</p>
<p># Port 21 is the standard FTP port, so don&#8217;t use it for security reasons (choose here the port you want)<br />
Port 1980</p>
<p># To prevent DoS attacks, set the maximum number of child processes<br />
# to 30. If you need to allow more than 30 concurrent connections<br />
# at once, simply increase this value. Note that this ONLY works<br />
# in standalone mode, in inetd mode you should use an inetd server<br />
# that allows you to limit maximum number of processes per service<br />
# (such as xinetd)<br />
MaxInstances 8</p>
<p># Set the user and group that the server normally runs at.<br />
User nobody<br />
Group nogroup</p>
<p># Umask 022 is a good standard umask to prevent new files and dirs<br />
# (second parm) from being group and world writable.<br />
Umask 022 022</p>
<p>PersistentPasswd off</p>
<p>MaxClients 8<br />
MaxClientsPerHost 8<br />
MaxClientsPerUser 8<br />
MaxHostsPerUser 8</p>
<p># Display a message after a successful login<br />
AccessGrantMsg &#8220;welcome !!!&#8221;<br />
# This message is displayed for each access good or not<br />
ServerIdent on &#8220;you&#8217;re at home&#8221;</p>
<p># Set /home/FTP-shared directory as home directory<br />
DefaultRoot /home/FTP-shared</p>
<p># Lock all the users in home directory, ***** really important *****<br />
DefaultRoot ~</p>
<p>MaxLoginAttempts 5</p>
<p>#VALID LOGINS</p>
<p>AllowUser userftp<br />
DenyALL<br />
Umask 022 022<br />
AllowOverwrite off</p>
<p>DenyAll<br />
Umask 022 022<br />
AllowOverwrite off</p>
<p>DenyAll<br />
Umask 022 022<br />
AllowOverwrite on</p>
<p>DenyAll AllowAll好了,你已经完成了proftpd的配置,你的服务端口是1980,而读取的参数如下,用户:sauron,密码:你为userftp设置的那个.4- 启动/停止/重启动你的服务:<br />
Code:<br />
sudo /etc/init.d/proftpd start<br />
sudo /etc/init.d/proftpd stop<br />
sudo /etc/init.d/proftpd restart对你的proftpd进行一下语法检查:<br />
Code:<br />
sudo proftpd -td5</p>
<p>想知道谁现在连接到你的服务,用ftptop命令(使用字母&#8221;t&#8221;来转换显示频率),你也可以使用&#8221;ftpwho&#8221;命令.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tisswb.com/archives/8.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

