Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Folder Permissions in Linux

Posted on 2008-06-23
3
Medium Priority
?
318 Views
Last Modified: 2013-12-16
I'm setting up an sftp and want one folder where people can add and remove files.

I want the group "sftp" to have read and write access to /home/sftp (this is not a home folder, just located there).

How can I do this so that any new files as well (uploaded by either user) can be rw to both users?
0
Comment
Question by:jjmartineziii
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 14

Accepted Solution

by:
agriesser earned 1000 total points
ID: 21847828
The group sftp needs to own this directory. That can be achieved by running:

chgrp sftp /home/sftp

And now you need to tell the filesystem that all files created in this directory will inherit its permissions from the directory itself. Therefore you need to set the setgid bit for that directory (therefore, all files will be created with the group set to sftp):

chmod 2775 /home/sftp

Now you need to set the umask for these two users to 002 instead of the default 022, that way all new files created will have rw-rw-r-- permissions (owner and group writable) and all new directories will have rwxrwxr-x.
0
 
LVL 2

Expert Comment

by:minibago
ID: 21847863

If your users are members of the group 'sftp' and it's the 'sftp' group that is putting the files in that folder then setting the group for that folder to 'sftp' like so (in a terminal):

chgrp -R sftp /home/sftp

Then give the group read and write access like so:

chmod g+r /home/sftp
chmod g+w /home/sftp


I hope that helps.

=)
0
 
LVL 12

Author Closing Comment

by:jjmartineziii
ID: 31469822
perfect
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
You ever wonder how to backup Linux system files just like Windows System Restore?  Well you can use Timeshift in Linux to perform those similar action.  This tutorial will show you how to backup your system files and keep regular intervals. Note…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question