Pages

Sabtu, 12 November 2011

FTP服务器中将用户限制在自己目录下的方法 FTP server will be limited to their own directory under the user's method of

Author: shellcode

第一步:创建一个ftp guest组,用groupadd命令,也可以用ftp服务器创建的ftp组(less /etc/group看看是否存在,如果装了ftp server的话都有这个组存在)。 The first step: creating a ftp guest group, using the groupadd command, ftp server can also be used to create the ftp group (less / etc / group to see if there is, if installed ftp server, then have this group exists).

第二步:在ftp组中添加ftp用户。 Step two: add the ftp ftp user group.

第三步:修改/etc/ftpaccess文件,加入guestgroup的定义: guestgroup ftp。 The third step: modify / etc / ftpaccess file, add guestgroup definition: guestgroup ftp. 或者用guestuser直接指定ftp用户名,如:guestuser ftpuser。 Or use guestuser directly specify ftp user name, such as: guestuser ftpuser.

第四步:向这个用户的$HOME目录下拷贝必要的文件,主要是与ls有关的。 Step four: to the user's $ HOME directory, copy the necessary files, mainly related with ls. 一般的ls要Lib支持,你得重新编译ls,或把lib目录copy过去.或者拷贝ftp server带的ls,比如把/home/ftp/下的bin,etc,lib三个目录拷贝到这个用户的根目录下,并修改权限(chown username.ftp *)。 Ls To Lib general support, you have to recompile ls, or the lib directory to copy the past, or copy ftp server with the ls, such as the / home / ftp / under the bin, etc, lib copy three directories to the user's root directory, and modify the permissions (chown username.ftp *).
注意:现在Linux下带的ftp无须拷贝这些文件,至少我用的Redhat6.1是不需要拷贝的。 Note: the ftp now under Linux with no need to copy these files, at least I do not need to use the Redhat6.1 copy. 所以我就省去了第四步。 So I save a fourth step.

相关信息: Information:
man ftpaccess 仔细阅读guestgroup和guestuser这一项。 man ftpaccess guestgroup and guestuser read this one.

Tidak ada komentar:

Posting Komentar