LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 06-16-2010, 12:02 PM   #1
old286
LQ Newbie
 
Registered: Jun 2010
Posts: 4

Rep: Reputation: 0
Jailing users with pure-ftpd


I installed pure-ftpd but I am having trouble in a few areas.

1. Is there a command to check to see if its actually running?

2. I tried starting it with "/usr/local/sbin/pure-ftpd &" but I got the error " Unable to start a standalone server address already in use.

So I tried adding this to the xinetd.conf file because I do see xinetd service running on my CentOS 5.4 server

service ftp
{
socket_type = stream
server = /usr/local/sbin/pure-ftpd
server_args = -A -E -i -L -R -s
protocol = tcp
user = root
wait = no
disable = no
}

Which should chroot everyone but when I log in with a user created with the useradd command he can still get to other folders and perform edits.

Now when I try to add a chrooted user with

"pure-pw mike -d /home/mike"

I get the Usage Manual and then
WARNING: that pure-ftpd server hasn't been compiled with puredb support.

I hope this is enough info and I know I haven't touch Linux in years and I have some refreshing to do.

Please help,
Mike
 
Old 06-16-2010, 01:12 PM   #2
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,938

Rep: Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330
Hi and welcome to LQ

1. If you're running pure-ftpd standalone, then you can use:
Code:
ps -ef|grep pure-ftpd
2. Are you sure that there is no other ftp server running. Disable pure-ftpd from xinetd, restart xinetd and run:
Code:
netstat -tanpl|grep 21
to see if there is another daemon listening on port 21
Quote:
Which should chroot everyone but when I log in with a user created with the useradd command he can still get to other folders and perform edits.
Could be because you use -L without a number. Better remove the -L option completely. Also IIRC you have to add "/./" after at the end of the home directory of a system user to keep him chrooted.
Quote:
I get the Usage Manual and then
WARNING: that pure-ftpd server hasn't been compiled with puredb support.
You should have compiled pure-ftpd with the --with-everything option (or at least with --with-puredb).
You should read this for managing virtual users.

Regards

Last edited by bathory; 06-17-2010 at 08:13 AM.
 
Old 06-16-2010, 05:22 PM   #3
old286
LQ Newbie
 
Registered: Jun 2010
Posts: 4

Original Poster
Rep: Reputation: 0
I didn't get a chance to try this at work today but I will post later tonight. Thanks much!!!
 
Old 06-17-2010, 01:17 PM   #4
old286
LQ Newbie
 
Registered: Jun 2010
Posts: 4

Original Poster
Rep: Reputation: 0
Jailing with pure-ftpd

OK now after I create a jailed virtual user, john, using the command:

pure-pw useradd john -u ### -g ### -d /sftpusers/john

I get no error msg but john can't login and the home directory doesn't get created but the

/etc/pureftpd.passwd has been written to with john's username and home dir and password

john:$1$0bkVndn0$pYVyeQ3Az.yjw/y6YDVw21:###:###::/sftpusers/john/./::::::::::::
 
Old 06-17-2010, 01:28 PM   #5
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,938

Rep: Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330
You need to add "-j" if you want the homedir to be created automatically

Regards
 
Old 06-17-2010, 02:16 PM   #6
old286
LQ Newbie
 
Registered: Jun 2010
Posts: 4

Original Poster
Rep: Reputation: 0
Jailing with pure-ftpd

message now is -j is not an option with 'pure-pw useradd'. Did you mean add it to the conf file?
 
Old 06-17-2010, 04:20 PM   #7
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,938

Rep: Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330Reputation: 1330
Oops I was not clear enough. The switch must be added among the other pure-ftpd options, so when the new user tries to login for the first time the homedir will be created if it doesn't exist.

Regards
 
  


Reply

Tags
chroot, jail, pureftpd


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't enable virtual users on pure-ftpd G-Fox Linux - Networking 1 03-25-2010 04:51 PM
Need help setting up virtual users with pure-ftpd GavB Linux - Software 4 08-07-2009 05:52 AM
I cannot use virtual users in pure-ftpd. kutlu Debian 0 01-05-2009 01:38 AM
pure-ftpd online users spotass Linux - Software 0 07-22-2004 11:33 AM
pure-ftpd virtual users problem stofferthebest Linux - Networking 0 04-12-2004 03:59 AM


All times are GMT -5. The time now is 06:20 AM.

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