Solved

Folder Permissions in Linux

Posted on 2008-06-23
3
307 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 250 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Using sort and uniq to pare down large syslog 6 107
Moving from Mcrypt to OpenSSL 18 75
trouble on installing syslog-ng on CentOS 7 7 157
SMTP log file for IMSVA 5 74
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 …
The purpose of this article is to show how we can create Linux Mint virtual machine using Oracle Virtual Box. To install Linux Mint we have to download the ISO file from its website i.e. http://www.linuxmint.com. Once you open the link you will see …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

739 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