How to run pure-ftpd as non root user?

Using applications, configuring, problems
Post Reply
Message
Author
User avatar
aliG
Posts: 76
Joined: Sun 15 Jul 2007, 09:52
Location: Glasgow, Scotland

How to run pure-ftpd as non root user?

#1 Post by aliG »

SYSTEM : Puppy 4.31, VIA Embedded PC, 2Gb CF card, Frugal install


I've Googled and cant find how to do this on puppy, hope someone can help me...

I want to use pure-ftpd for non anonymous file transfer on my embedded PC, I have created user "ftp_user" with a home directory in /mnt/home/ftp_user (the CF card). The user is a member of group file_ops.

Code: Select all

#id ftp_user
uid=1004(ftp_user) gid=1004(1004) groups=1004(1004),1000(file_ops)
# 


currently I launch the daemon with the command

Code: Select all

pure-ftpd -A & 
All works fine the user is chroot'ed to the Cf card only, everything is fine except the files uploaded by ftp_user are all owned by root

Code: Select all

# cd /mnt/home/ftp_user
# ls -l
total 12
-rwxr-xr-x 1 root root 7499 2011-05-21 18:43 test_file
How can I launch the daemon as the user ftp_user, (which is probably the most secure way of doing it) or get the daemon to chown the files back to the ftp_user?

I tried the following but get the error

Code: Select all

su -c '/usr/sbin/pure-ftpd -A' - ftp_user

Unable to start a standalone server: Permission denied
Currently I'm typing at the command prompt - but ultimately I want to add to the end of /etc/rc.d/rclocal

Thanks for reading this far!

Alison

Fractal
Posts: 8
Joined: Wed 08 Dec 2010, 11:54

#2 Post by Fractal »

Can anyone answer this?

I have a similar issue - I want to create ftp users and have them point at their own directory.

WillM
Posts: 173
Joined: Wed 30 Dec 2009, 04:42
Location: Oakland, California

#3 Post by WillM »

su -c '/usr/sbin/pure-ftpd -A' - ftp_user

Unable to start a standalone server: Permission denied
When you stop to think about it, I don't think a FTP server will allow itself to be started as an under privileged user.

To change the owner and group of those files in the FTP folder;

Code: Select all

chown -R ftp_user:ftp_user /mnt/home/ftp_user

Post Reply