[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FTP access



Actually, I just did this today, so I'll spare you the RTFMs:

1. create your user
2. edit /etc/passwd: make his home path something like: /dir/that/should/be/root/./directory/to/start/in

This will do the following: Whenever your user will do cd/, he'll be in /dir/that/should/be/root.
The initial FTP login, however, will be in /dir/that/should/be/root/./directory/to/start/in
Note the /./ in the middle.

3. edit /etc/passwd to change the login shell to: /usr/bin/passwd (if you want to allow him to use telnet to change his password. Use /bin/true otherwise)
4. edit /etc/shells and make sure the shell you put in (3) appears. This tells ftp that the shell you put in is valid (although it does nothing - which is what you apparentely want)
5. edit /etc/ftpaccess and add the line:
guestgroup youruser
(of course, if a guestgroup entry exists, simple add your user to it).
6. make sure your "home" directory (/dir/that/should/be/root/) contains the following subdirectories:
bin
etc
lib
pub

This is to give the "illusion" to chroot that this is a valid root directory.

the directory etc should contain a passwd file, and a group file (this is world readable, so make sure it's not the real passwd!)
lib should contain some libraries files, my advice is to copy some ready made ftp root directory (/home/ftp is one) and simply use it.


I think that's all. (Did I forget anything?)

If there's a shorter way to do it (Ira - without replacing the FTPd) I'll be glad to know.

Mike Almogy wrote:

> Hi all.
> Does anyone knows how to set the FTP directory to be a root directory when
> accessing via FTP program ???
> that means that when someone will try to access the etc directory he will
> be directed to /home/ftp/etc ext'
>
> Thanks
>
> Mike
>
> (P.S , the image file from Hetz Ben Hamo server works fine, The RedHat 5.2
> is amazing :-)))) )

--
-------------------------
Aviram Jenik

"Addicted to Chaos"

-------------------------
Today's quote:
All the wastes in a year from a nuclear power plant
can be stored under a desk.
                         - Ronald Reagan, quoted in "Burlington Free Press",
                              15 February 1980

S/MIME Cryptographic Signature