Solved

Linux user/group for shell and ftponly

Posted on 2004-08-08
3
501 Views
Last Modified: 2012-08-14
Hi,

user ABC can ssh login and ftp to the server, /home/ABC

user XYZ only can ftp, ftpchroot to /home/ABC/www/*

the problem are:

there might have some html is www created by ABC, but  XYZ might modify/overwrite the html via ftponly,

hows the file ownership & group looks like which able to allow
ABC to access/modified/create the html as well as
XYZ to access/modified/create html in www directory
0
Comment
Question by:qazakax
  • 2
3 Comments
 
LVL 23

Expert Comment

by:Mysidia
ID: 11748824
You want /home/ABC/www  to be writable by both, but not allow XYZ to modify/overwrite files created by ABC?

Then use the sticky bit

chown abc.ftponly /home/ABC/www
chmod 1771 /home/ABC/www
or chmod +t /home/ABC/www

(That would be a similar stuation as with /tmp... only the file's creator should be able to update the files)

for ABC to access/modify/create content, make him the owner
for ftponly to be able to write to www make that the group and set group write.

In short
drwxrwx--t        ABC  ftponly          ...           www/


0
 

Author Comment

by:qazakax
ID: 11755011
Hi,

basically i wan /home/ABC/www can be writable by both, n also allow either ABC or XYZ can modify/overwrite the files.

then in /etc/group should be like this ??
ABC:x:500:ABC,XYZ

0
 
LVL 23

Accepted Solution

by:
Mysidia earned 25 total points
ID: 11758407
In that case, yes, put both users in the same group.

And have the directory owned by the group

and make the mode for /home/abc/www

chown user.group /home/abc/www
chmod 2771 /home/abc/www

(setguid  for a directory means new files will be owned by the same group by default)
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
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…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

810 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