LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 10-27-2012, 12:48 PM   #1
Juc1
Member
 
Registered: Sep 2011
Location: UK
Posts: 83

Rep: Reputation: 6
Question SSH / FTP user permissions


Hi all,

My Debian 5 root / administrator can see all directories. My website files are stored in /var/www/vhosts/example.com/httpdocs. I have created a user (jim24) who can get as far as /var/www/vhosts/example.com/httpdocs but then can't open the httpdocs directory - permission denied.

Can anyone please tell me how I give all relevant permissions to jim24 for the httpdocs directory?

Thank you
 
Old 10-27-2012, 05:02 PM   #2
KinnowGrower
Member
 
Registered: May 2008
Location: Toronto
Distribution: Centos && Debian
Posts: 347

Rep: Reputation: 34
You can add user jim24 to the group, that owns httpdocs directory. I am assuming group has read and execute permissions at least on httpdocs

to add jim24 to the group
Code:
usermod -a -G groupname jim24
Hope it helps
 
Old 10-27-2012, 05:21 PM   #3
Juc1
Member
 
Registered: Sep 2011
Location: UK
Posts: 83

Original Poster
Rep: Reputation: 6
Quote:
Originally Posted by KinnowGrower View Post
You can add user jim24 to the group, that owns httpdocs directory. I am assuming group has read and execute permissions at least on httpdocs
Ok thanks but how can I see which group owns the httpdocs directory?
 
Old 10-28-2012, 06:10 AM   #4
Juc1
Member
 
Registered: Sep 2011
Location: UK
Posts: 83

Original Poster
Rep: Reputation: 6
Quote:
Originally Posted by Juc1 View Post
Ok thanks but how can I see which group owns the httpdocs directory?
I think this says that the directory /var/www/vhosts is owned by the group 'root'...

Code:
$ ls -l /var/www/vhosts
total 16
drwxr-xr-x 10 root root 4096 Dec 15  2010 chroot
drwxr-xr-x  5 root root 4096 Oct 21  2010 default
drwxr-xr-x 14 root root 4096 Oct 10  2011 example1.com
drwxr-xr-x 14 root root 4096 Jan 19  2011 example2.com
$
So if I add my user to the group 'root' then he should have all permissions for the website directories example1.com, example2.com etc?

Thanks
 
Old 10-28-2012, 09:40 AM   #5
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
I think it's a bad idea to make any ordinary user a member of the root group.

You might be able to use ACLs to solve your problem. Because the directory is owned by root, run the below command as root

Code:
setfacl -m u:jim24:rwx /var/www/vhosts/example1.com/httpdocs
It's a modification on commands I used in http://www.linuxquestions.org/questi...-group-730046/ to allow apache to write somewhere in a user's home directory. If you get errors like "operation not permitted", check post #3 in the above thread.

PS
You might need to install some SW to support ACL. E.g. Ubuntu 10.04 does not seem to support it out-of-the-box while 12.04 does.

PPS
If ACLs are too much work to get going, I would change the group of the directory /var/www/vhosts/example1.com/httpdocs from root to something like www-users (and create that group as well) and make jim24 a member of that. Change the permissions on that directory to 775 in that case.

Last edited by Wim Sturkenboom; 10-28-2012 at 09:53 AM.
 
Old 10-28-2012, 06:40 PM   #6
KinnowGrower
Member
 
Registered: May 2008
Location: Toronto
Distribution: Centos && Debian
Posts: 347

Rep: Reputation: 34
if /var/www/vhosts/httpdos is Document root for Apache, it would also be good, if owned by www-data user and www-data group. So as per my knowledge, if you change ownership for that directory and make user jim24 member of www-data group it would be ok.
 
  


Reply



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
FTP user permissions cbc Linux - Server 3 06-19-2011 09:14 PM
User permissions - FTP - Samba stascrash Linux - General 3 05-16-2010 06:24 AM
FTP user permissions MATRIX_q Linux - Software 2 08-26-2009 11:08 PM
Need help configuring permissions to allow FTP access via SSH/SFTP. dhupke Linux - General 5 06-12-2007 12:26 PM
ftp user permissions rkemp Linux - Networking 1 10-05-2004 02:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:39 AM.

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