LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   Groups / User loosing read / write permissions? (https://www.linuxquestions.org/questions/debian-26/groups-user-loosing-read-write-permissions-4175580384/)

DeadIntermediate 05-21-2016 08:39 PM

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.

HMW 05-22-2016 10:36 AM

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

DeadIntermediate 05-23-2016 05:23 PM

Quote:

Originally Posted by HMW (Post 5549226)
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

HMW 05-24-2016 04:50 AM

Quote:

Originally Posted by DeadIntermediate (Post 5549869)
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

DeadIntermediate 05-25-2016 06:25 AM

It was happening before the stick bit. I'll try removing that and see what happens in a couple of days.

rknichols 05-25-2016 08:26 AM

Quote:

Originally Posted by DeadIntermediate (Post 5549869)
The output is:
Code:

drwxrwsrw- 17 root ftpaccess 4096 May 21 00:15 /home

Quote:

Originally Posted by HMW (Post 5550057)
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.

HMW 05-25-2016 10:13 AM

Quote:

Originally Posted by rknichols (Post 5550595)
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! :doh:


All times are GMT -5. The time now is 10:12 PM.