LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Need Some FTP help (http://www.linuxquestions.org/questions/linux-software-2/need-some-ftp-help-832615/)

xxdxhxx 09-16-2010 01:06 PM

Need Some FTP help
 
Hello.

I have a LAMP server running. Currently there are not vhosts, just the basic single site apache2 running a web app.

I want to set up ftp access to the www root, but my attempts have failed.
When I try to ftp using the user I created, I get dumped in the users home directory. I can also browse the entire file system. What I can't do is upload content to the www root. I get permission errors.

How can I set ftp up to allow a user to access the www root only?
Any help or links would be appreciated.

Thanks for reading

bathory 09-16-2010 05:24 PM

Hi,

You didn't say what distro and ftp server you're using, so we can help you better on this.
Anyway, you can modify the existing user and set his homedir to be the document root of your webserver.

Regards

xxdxhxx 09-17-2010 01:19 PM

Quote:

Originally Posted by bathory (Post 4099831)
Hi,

You didn't say what distro and ftp server you're using, so we can help you better on this.
Anyway, you can modify the existing user and set his homedir to be the document root of your webserver.

Regards


Hi,

I am using Ubuntu 10.04 64 bit using proftp as the ftp server.
I have uninstalled proftp, so right now I have no ftp server installed.( I want to start from scratch so I better understand the steps that need to be taken.

I am a novice, so forgive me for not knowing how to set a homedir or modify permissions.

Thanks for your help

adenial 09-17-2010 01:35 PM

Why dont you simply copy that www content from root to /pub if you are logging in as anonymous user, or copy to user's home directory if logging in as non-anonymous user.

bathory 09-17-2010 02:03 PM

Hi,

The easiest thing you can do, is to reinstall proftpd and create a symbolic link to /var/www from the user's home directory:
Code:

ln -s /var/www /home/<username>/
(you should replace <username> with the actual existing user name.
Then make sure that this user has write permissions on that directory:
Code:

chown -R <username> /var/www
Regards

xxdxhxx 09-17-2010 06:14 PM

Quote:

Originally Posted by bathory (Post 4100906)
Hi,

The easiest thing you can do, is to reinstall proftpd and create a symbolic link to /var/www from the user's home directory:
Code:

ln -s /var/www /home/<username>/
(you should replace <username> with the actual existing user name.
Then make sure that this user has write permissions on that directory:
Code:

chown -R <username> /var/www
Regards

AhhHaa.

Perfect.

This is exactly what I wanted to do.
Is there a way I can keep them locked into that directory so they can't browse the system?

bathory 09-18-2010 02:29 AM

Hi,

Chrooting a user in his home directory is the default setting for proftpd. You can check if you have:
Code:

DefaultRoot ~
in proftpd.conf and add it if it doesn't exist.
Of course the user will be jailed in /home/user, not /home/user/www. That's why I told you to create/modify the user to have a homedir like /var/www.

Regards

prayag_pjs 09-18-2010 03:23 AM

Create a user with -d option mentioning the path you want the user to login then anon_root and local_root options will help you achieve what you want

Quote:

useradd -d /var/ftp/pub/prayag prayag

anon_root = /var/ftp/pub/prayag

prayag_pjs 09-18-2010 03:25 AM

http://techpubs.sgi.com/library/tpl/...pd.conf.5.html


this link will be useful for you

xxdxhxx 09-20-2010 12:31 PM

Thanks for all the help.
I have this running the way I wanted.
Thanks again.

David


All times are GMT -5. The time now is 08:03 PM.