LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
LinkBack Search this Thread
Old 08-12-2004, 04:29 AM   #1
Niels@debian
LQ Newbie
 
Registered: Aug 2004
Location: Laval, FR
Distribution: Debian Sarge 2.6.9
Posts: 25

Rep: Reputation: 15
[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

Last edited by Niels@debian; 08-12-2004 at 05:16 PM.
 
Old 08-12-2004, 07:51 AM   #2
Donboy
Member
 
Registered: Aug 2003
Location: Little Rock, Arkansas
Distribution: RH, Fedora, Suse, AIX
Posts: 736

Rep: Reputation: 31
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.
 
Old 08-12-2004, 07:57 AM   #3
Niels@debian
LQ Newbie
 
Registered: Aug 2004
Location: Laval, FR
Distribution: Debian Sarge 2.6.9
Posts: 25

Original Poster
Rep: Reputation: 15
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>

Last edited by Niels@debian; 08-12-2004 at 08:00 AM.
 
Old 08-12-2004, 08:49 AM   #4
Punker51
Member
 
Registered: Dec 2003
Posts: 37

Rep: Reputation: 15
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
 
Old 08-12-2004, 05:15 PM   #5
Niels@debian
LQ Newbie
 
Registered: Aug 2004
Location: Laval, FR
Distribution: Debian Sarge 2.6.9
Posts: 25

Original Poster
Rep: Reputation: 15
Thanks a lot Punker51 DefaultRoot /home/user user was what i was searching for
 
Old 08-12-2004, 07:38 PM   #6
Donboy
Member
 
Registered: Aug 2003
Location: Little Rock, Arkansas
Distribution: RH, Fedora, Suse, AIX
Posts: 736

Rep: Reputation: 31
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
chrooted users changing their passwords btmiller Linux - Security 2 07-16-2005 01:08 PM
VSFTP Virtual Users chrooted to NTFS Help please murdocthecrackmongre Linux - Software 2 07-05-2005 06:43 PM
cron for chrooted users metobln Linux - Software 4 04-24-2005 05:39 AM
Jailed(chrooted) users and ftp linux_terror Linux - Security 4 08-29-2004 06:56 PM
Permitting a user to write to another users home directory rddreamz Linux - Newbie 4 11-19-2003 01:01 AM


All times are GMT -5. The time now is 02:36 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration