LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 05-21-2016, 08:39 PM   #1
DeadIntermediate
LQ Newbie
 
Registered: May 2016
Posts: 4

Rep: Reputation: Disabled
Groups / User loosing read / write permissions?


Hello, I have a Dedicated server that i run a couple of game servers on.

For Security purposes, I have disable root access and have created a few access for people to access the server.

I have created a group called 'ftpacess' and have the users set to those group access to the /home Directory.

But it seems like everyone a file is changed / removed or added. Seems like the user who are connected on via FTP (Using FileZilla), when they try to unload, download or a change a file name, they get "Permission denied".

Am I doing something wrong?

I have used the following commands:
chmod g+w -R home
chmod g+r -R home

and some times I have to run:
chgrp -R ftpaccess home

I would love to hear any suggestions or tips on how I can improve this and thanks.
 
Old 05-22-2016, 10:36 AM   #2
HMW
Member
 
Registered: Aug 2013
Location: Sweden
Distribution: Debian, Arch, Red Hat, CentOS
Posts: 773
Blog Entries: 3

Rep: Reputation: 369Reputation: 369Reputation: 369Reputation: 369
Hi!

That is, imho, a slightly odd approach. I would have created a directory _inside_ /home for the ftp users. Something like:
Code:
/home/ftpusers
But, never mind that for now. What is the output of:
Code:
ls -ld /home
Best regards,
HMW
 
Old 05-23-2016, 05:23 PM   #3
DeadIntermediate
LQ Newbie
 
Registered: May 2016
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by HMW View Post
Hi!

That is, imho, a slightly odd approach. I would have created a directory _inside_ /home for the ftp users. Something like:
Code:
/home/ftpusers
But, never mind that for now. What is the output of:
Code:
ls -ld /home
Best regards,
HMW
The output is:
Code:
drwxrwsrw- 17 root ftpaccess 4096 May 21 00:15 /home
 
Old 05-24-2016, 04:50 AM   #4
HMW
Member
 
Registered: Aug 2013
Location: Sweden
Distribution: Debian, Arch, Red Hat, CentOS
Posts: 773
Blog Entries: 3

Rep: Reputation: 369Reputation: 369Reputation: 369Reputation: 369
Quote:
Originally Posted by DeadIntermediate View Post
The output is:
Code:
drwxrwsrw- 17 root ftpaccess 4096 May 21 00:15 /home
You have a sticky bit on the directory, that is most likely why.
Quote:
Originally Posted by Wikipedia
When a directory's sticky bit is set, the filesystem treats the files in such directories in a special way so only the file's owner, the directory's owner, or root can rename or delete the file. Without the sticky bit set, any user with write and execute permissions for the directory can rename or delete contained files, regardless of the file's owner. Typically, this is set on the /tmp directory to prevent ordinary users from deleting or moving other users' files.
https://en.wikipedia.org/wiki/Sticky_bit

Best regards,
HMW
 
Old 05-25-2016, 06:25 AM   #5
DeadIntermediate
LQ Newbie
 
Registered: May 2016
Posts: 4

Original Poster
Rep: Reputation: Disabled
It was happening before the stick bit. I'll try removing that and see what happens in a couple of days.
 
Old 05-25-2016, 08:26 AM   #6
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,777

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Quote:
Originally Posted by DeadIntermediate View Post
The output is:
Code:
drwxrwsrw- 17 root ftpaccess 4096 May 21 00:15 /home
Quote:
Originally Posted by HMW View Post
You have a sticky bit on the directory, that is most likely why.
That is not the sticky bit. That is the setgid bit, which causes newly created files and subdirectories to inherit the GID of the parent directory.

BTW, those are really weird permissions for /home. The "rw-" permissions for "other" allows everybody to rename anyone's home directory. Actually setting the sticky bit ("chmod +t /home") would prevent that.

Last edited by rknichols; 05-25-2016 at 08:33 AM.
 
1 members found this post helpful.
Old 05-25-2016, 10:13 AM   #7
HMW
Member
 
Registered: Aug 2013
Location: Sweden
Distribution: Debian, Arch, Red Hat, CentOS
Posts: 773
Blog Entries: 3

Rep: Reputation: 369Reputation: 369Reputation: 369Reputation: 369
Quote:
Originally Posted by rknichols View Post
That is not the sticky bit. That is the setgid bit, which causes newly created files and subdirectories to inherit the GID of the parent directory.
Yes, of course, you are right. Total brain freeze on my part!
 
  


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
Mounting cifs with read/write permissions for a non-root user icmp_request Linux - Networking 5 01-28-2014 12:33 PM
How to Give Read Write Permissions to a Particular User on a Folder Nanosuz Linux - General 1 08-16-2013 10:21 AM
Read, Write, User Permissions on a FAT32 partition hdensley Linux - Newbie 1 07-26-2009 11:05 AM
Mounting cifs with read/write permissions for a non-root user icmp_request Linux - Newbie 5 07-09-2009 08:16 PM
Granting full read/write permissions to all files for a specific user laserjim Linux - Security 10 01-31-2009 11:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 05:04 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