[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: [LI] FTP restrictions...



R Manoj forced the electrons to say:
> Hello Thaths,
> I tried your suggestion to prevent the user from browsing anyother directory
> than his/her home dir while FTP. But it doesn't work.
> The line in my /etc/passwd is like this :-
> user_login::511:100::/home/user_login/./:/bin/false
> 
> But still the user is able to browse all the file systems. Am i missing
> something else ? I am using RH 5.2 with FTP server (version
> wu-2.4.2-academ[BETA-18] ) .
> 
> Thanks a lot,
> Manoj.
> 

Actually, this is slightly more complicated than this.

A step by step instruction set:

Let us assume you want to create a user ftponly to have only ftp access
to his account on your linux machine. Go through the following steps.

1. Add the user (using linuxconf, let us say). Set his shell as /bin/false.

2. Add /bin/false to /etc/shells.

3. Edit /etc/passwd and change the line of ftponly to:

ftponly:<passwd>:uid:gid:OnlyFTP:/home/ftponly/.//:/bin/false
(note the new and improved home field)

4. If you are using RHL, then the group of ftponly is also ftponly. So
add the line

guestgroup ftponly ftponly

to /etc/ftpaccess.

Create the directories /usr/ftponly/{bin,etc,lib} and the files inside
them.  You can (and should) use the anonymous ftp login's home directory
for the required files and permissions.

Since ftpd runs from inetd, the whole setup is complete. Test the new
ftponly login that you have created and release it to the user.

Note: The whole procedure is RHL and WU-FTPD specific. See man ftpaccess
for more details of the ftpaccess file.

More to note: Any further user can be added to this restricted set
by setting his group as ftponly and setting up his home as for the
first user.

Binand

-- 
#include <stdio.h>                                   | Binand Raj S.
char *p = "#include <stdio.h>%cchar *p = %c%s%c;     | This is a self-
int main(){printf(p,10,34,p,34,10);return 0;}%c";    | printing program.
int main(){printf(p,10,34,p,34,10);return 0;}        | Try it!!
--------------------------------------------------------------------
The Linux India Mailing List Archives are now available.  Please search
the archive at http://lists.linux-india.org/ before posting your question
to avoid repetition and save bandwidth.