LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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
  Search this Thread
Old 09-16-2010, 12:06 PM   #1
xxdxhxx
LQ Newbie
 
Registered: Nov 2009
Posts: 7

Rep: Reputation: 0
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
 
Old 09-16-2010, 04:24 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
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
 
Old 09-17-2010, 12:19 PM   #3
xxdxhxx
LQ Newbie
 
Registered: Nov 2009
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by bathory View Post
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
 
Old 09-17-2010, 12:35 PM   #4
adenial
Member
 
Registered: Sep 2010
Location: Bangalore, India
Distribution: rhel5, ubuntu9.04(occassionally), Debian.
Posts: 87

Rep: Reputation: 5
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.
 
Old 09-17-2010, 01:03 PM   #5
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
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
 
1 members found this post helpful.
Old 09-17-2010, 05:14 PM   #6
xxdxhxx
LQ Newbie
 
Registered: Nov 2009
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by bathory View Post
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?
 
Old 09-18-2010, 01:29 AM   #7
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
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
 
1 members found this post helpful.
Old 09-18-2010, 02:23 AM   #8
prayag_pjs
Senior Member
 
Registered: Feb 2008
Location: Pune - India
Distribution: RHEL/Ubuntu/Debian/Fedora/Centos/K3OS
Posts: 1,159
Blog Entries: 4

Rep: Reputation: 149Reputation: 149
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

Last edited by prayag_pjs; 09-18-2010 at 02:25 AM.
 
1 members found this post helpful.
Old 09-18-2010, 02:25 AM   #9
prayag_pjs
Senior Member
 
Registered: Feb 2008
Location: Pune - India
Distribution: RHEL/Ubuntu/Debian/Fedora/Centos/K3OS
Posts: 1,159
Blog Entries: 4

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


this link will be useful for you
 
1 members found this post helpful.
Old 09-20-2010, 11:31 AM   #10
xxdxhxx
LQ Newbie
 
Registered: Nov 2009
Posts: 7

Original Poster
Rep: Reputation: 0
Thanks for all the help.
I have this running the way I wanted.
Thanks again.

David
 
  


Reply

Tags
ftp, lamp, ubuntu



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
when I use ftp://user@ftp.blah.com it works. But when I type just ftp.blah.com says.. hunterhunter Linux - General 15 03-05-2014 09:12 AM
ftp : need to transfer 2.5terrabyte(huge number of files), good ftp program ? ghoulsblade Linux - Software 8 10-29-2009 03:59 AM
Read a text file and ftp files using bash w/out leaving the ftp prompt dj_tyr Linux - Newbie 6 10-12-2009 06:46 PM
files not visible in ftp site (but present in the /var/ftp/folder of the server) dongrila Linux - Newbie 2 12-23-2007 10:09 PM
problem with ftp on mandrake 10.1 Official, ftp speeds system wide (anybody noticed?) equinox Mandriva 15 11-10-2004 02:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration