exit 1
esac
if [ $# -gt 1 ]; then
shift
$0 $*
fi
exit 0
#######脚本结束#########
[/code:1:0258b10472]
按Esc,输入:x保存。
修改权限,然后添加到系统服务并启动
[code:1:0258b10472]
chmod +x /etc/rc.d/init.d/proftpd
chkconfig --add proftpd
service proftpd start[/code:1:0258b10472]
以后可以用service proftpd restart来重起proftpd。
6 一点体会
看proftpd的文档翻译过的一句话:Finally, a special command is allowed which can be used to control login access: LOGIN Connection or login to
the server. Applying a <Limit> to this pseudo-command can be used to allow or deny initial connection or login to the context. It has no
effect, and is ignored, when used in a context other than server config, <VirtualHost> or <Anonymous> (i.e. using it in a <Directory> context
is meaningless).
翻译下:最后,有一个用来限制登陆的特殊命令,就是LOGIN。在<limit>中用这个,可以禁止或者允许连接进来。但是,如果不在Server config,<VirtualHost>
或者<Anonymous>中使用的话,他将失去效用,或者说被忽略掉(比如在<Directory>中使用就是无效的)。
proftpd感觉还是比vsftp功能配置上好用一点,主要掌握好<limit>段基本上应用来说就没有问题了。
proftpd文档地址http://www.proftpd.org/docs/。[/code]
修改了好几次了,之前有些笔误和忘记写的地方,有什么问题大家提出来,我会及时修改的。谢谢。
| wd 回复于:2004-06-11 16:28:50 |
| 虽然关键内容不是我的原创,比如那个脚本(我不会写脚本,呵呵),可是好歹也写了半天,呵呵。
欢迎拍转。 |
| daminggege 回复于:2004-06-13 15:48:41 |
| 我照着别人的配置都不能运行,用这个可以
比较一下好像就这两句有区别,麻烦告知 |
| daminggege 回复于:2004-06-13 16:02:24 |
| 照着http://www.chinaunix.net/jh/15/247811.html,设置
useradd -d /home/kaoyan -g ftpusers -s /bin/false kaoyan useradd -d /home/kaoyan -g ftpusers -s /bin/false upload 不能访问,如果把false换成bash就可以,为什么???!??! |
| mswhome 回复于:2004-06-13 16:14:22 |
| 有没有人告诉我为什么我的Linux上不能使用chkconfig命令? |
| wd 回复于:2004-06-14 13:41:36 |
| [quote:aadb08de32="daminggege"]照着http://www.chinaunix.net/jh/15/247811.html,设置
useradd -d /home/kaoyan -g ftpusers -s /bin/false kaoyan useradd -d /home/kaoyan -g ftpusers -s /bin/false upload 不能访问,如果把false换成bash..........[/quote:aadb08de32] 把false换成nologin也可以。 |
| daminggege 回复于:2004-06-14 18:03:44 |
| 楼主,能否清楚的解释一下 |
| wd 回复于:2004-06-14 20:41:32 |
| 不太清楚,呵呵
是不是因为系统没有/bin/false这个shell啊? |
| daminggege 回复于:2004-06-14 21:52:33 |
| false,好象是不为此用户提供shell环境 这样是不是更安全呢? 本人菜鸟,多谢指教 |
| wd 回复于:2004-06-15 08:50:35 |
| nologin也是这个效果。。。 |
| smgxnet 回复于:2004-06-16 22:54:16 |
| 请问要求不同目录,有不同用户和各自的权限能够ftp进去,该怎么做???
例如:test用户拥有11文件夹的写权限,test2用户拥有22文件夹的写权限。 希望不吝指教!谢谢! |
| wd 回复于:2004-06-17 09:48:15 |
| test,test2设置到一个组,然后chmod /dir目录775,然后
test,test2都对目录/dir/11和/dir/22有写权限了 如果想分开,可以用 MKD / XMKD 创建目录 RNFR / RNTO 改名 DELE 删除 RMD / XRMD 移动 RETR / STOR 下载/上传 差不多了吧 可以来这里看看 http://www.proftpd.org/docs/directives/linked/config_ref_Limit.html |
| smgxnet 回复于:2004-06-17 10:41:39 |
| [quote:d79831187a="wd"]test,test2设置到一个组,然后chmod /dir目录775,然后
test,test2都对目录/dir/11和/dir/22有写权限了 如果想分开,可以用 MKD / XMKD 创建目录 RNFR / RNTO 改名 DELE 删除 RMD / XRMD 移动 RETR&nbsbsp;/ STOR 下..........[/quote:d79831187a] 感谢wd!我有点笨。呵呵! 能否具体告知步骤呢?? |
| wd 回复于:2004-06-17 11:18:53 |
| 不能。呵呵 |
| dslz 回复于:2004-07-08 11:50:02 |
| 我为什么在执行这个命令时提示找不到目录????
chkconfig --add profptd service proftpd start 那现在我要怎样才能启动呀???? |
| dslz 回复于:2004-07-10 10:17:20 |
| ??? |
| opem 回复于:2004-09-13 17:31:39 |
| [quote:5665bbca0e="daminggege"]楼主,能否清楚的解释一下:把false换成nologin还是不能访问[/quote:5665bbca0e]
在配置文件中加上: RequireValidShell off |
| opem 回复于:2004-09-13 17:34:18 |
| [quote:252f870ff5="dslz"]我为什么在执行这个命令时提示找不到目录????
chkconfig --add profptd service proftpd start 那现在我要怎样才能启动呀????[/quote:252f870ff5] 楼主把proftpd误写成了profptd.这两句没有别的问题,执行完最后一句就能启动了 |
| xcarb 回复于:2004-09-19 11:39:58 |
| [root@localhost proftpd-1.2.9]# service proftpd restart
/etc/init.d/proftpd: line 1: tartup: command not found /etc/init.d/proftpd: line 1: tartup: command not found Shutting down proftpd: [ 确定 ] /etc/init.d/proftpd: line 1: tartup: command not found Starting proftpd: bsp; [ 确定 ] 出现这种情况怎么解决 ? |
| opem 回复于:2004-09-21 10:38:15 |
| [quote:b0bc293da6="xcarb"]]
出现这种情况怎么解决 ?[/quote:b0bc293da6] 我估计是你的proftpd中第一行"# Startup script for ProFTPD"漏掉了"# S"才会出现系统找不到tartup命令的错误提示,查查看,不行把proftpd贴出来. |
| wd 回复于:2004-10-28 08:48:09 |
| 我最近用的一个proftpd的配置文件,只允许ph用户登陆,ph用户在/var/ftp/upload目录下可以上传。
[code:1:46fab269bb] ServerName "Test ftp server..." ServerType standalone DefaultServer on Port 21 Umask 022 MaxInstances 30 User ph Group ph UseReverseDNS off IdentLookups off MaxLoginAttempts 3 MaxClientsPerHost 2 MaxClients 20 DirFakeUser On ftp DirFakeGroup On ftp DeferWelcome On SystemLog /var/log/proftpd.log ServerIdent off DefaultRoot ~ ph,ph <limit LOGIN> Order allow,deny DenyUser !ph </limit> <Directory /> AllowOverwrite on AllowStoreRestart on # AllowForeignAddress on <Limit APPE DELE MKD RMD RNTO STOR XMKD XRMD> DenyUser ph </Limit> </Directory> <Directory /var/ftp/upload> <Limit APPE MKD STOR> AllowUser ph </Limit> </Directory> [/code:1:46fab269bb]
本文关键:安装配置一个proftpd的实例
相关方案
|