LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   ProFTPD for chrooted users (/home/hosting/user) ? (https://www.linuxquestions.org/questions/linux-software-2/proftpd-for-chrooted-users-home-hosting-user-216579/)

Niels@debian 08-12-2004 04:29 AM

[solved] ProFTPD for chrooted users (/home/hosting/user) ?
 
Hello.

As u can see i've decided to put my users in jail.
Their home directory is now /home/hosting/user

These users must have ftp capabilities but as I speak their login is rejected by the Proftpd server... (SSH works well).

Instead my default login niels (home/niels) is working great.

My /etc/passwd for example :

[...]
myweb:x:1001:1002:hosting:/home/hosting/myweb/:/bin/chroot
[...]

where /bin/chroot is a little script that execute the chroot command.

If u know how i can configure ProFTPd to work with chrooted users and niels, you'll be welcome :)

NB : myweb isn't in ftp_users :p

Donboy 08-12-2004 07:51 AM

You shouldn't have to use any special shell to get the chrooting. YOu can go to your proftpd.conf file and put the following...

DefaultRoot ~

Which sets the default root directory to the [logged in] users's home directory.

Niels@debian 08-12-2004 07:57 AM

I've already done it . Here is my whole proftpd.conf

Code:


ShowSymlinks                    on
AllowOverwrite                  on

TimeoutNoTransfer              600
TimeoutStalled                  600
TimeoutIdle                    1200

DisplayLogin                    welcome.msg
DisplayFirstChdir              .message
ListOptions                    "-l"

DenyFilter                      \*.*/

Port                            21

MaxInstances                    30

User                            nobody
Group                          nogroup

<Directory /*>
  Umask                        022  022
  AllowOverwrite                on
</Directory>


<Global>
  DefaultRoot                  ~
  AllowOverwrite              yes
  MaxClients                  8
  MaxClientsPerHost            1
  UseFtpUsers                  on
  AllowForeignAddress          on
  ServerIdent                  on      "ProFTP Server Ready"
  AccessGrantMsg              "Bienvenue %u sur le serveur"
</Global>


Punker51 08-12-2004 08:49 AM

DefaultRoot ~ isnt enough

u nee this line too:

DefaultRoot /home/user user

then restart proftpd ur users will be jailed

or download my script, it will do it for you at : http://justdome.afraid.org/~punker/uploads/userset

chmod it to 777
copy it to /usr/bin and vi it, ull find all info needed
then just type userset as SU

Niels@debian 08-12-2004 05:15 PM

Thanks a lot Punker51 DefaultRoot /home/user user was what i was searching for :)

Donboy 08-12-2004 07:38 PM

Man, this comes as QUITE a surprise to me. I've been running Proftpd for about a year now and I've never needed that extra DefaultRoot directive and my users are jailed just fine.


All times are GMT -5. The time now is 04:50 PM.