You are not logged in.

#1 2014-12-27 10:08:31

scar
Member
From: Hungary
Registered: 2009-10-01
Posts: 442

Locally shared folder - permissions problem [SOLVED]

Well, I've posted this under system administraition, I hope it belongs here.

I have a box where I wanted to share a folder between some local users.
I've created a directory - let's say "/home/shared" - where the directory owner is "shareowner" and the group is "sharegroup".
My local users were added to the "sharegroup" group.
The whole directory is chmod-ed with chmod 2775
All the local users have "umask 002" in ~/.profile

When I create new directories and files, all the permissions are correct (775 for dirs and 664 for files),
but when I try to copy already existing files to the shared directory, the files keep their previously assigned permissions.

What can I do for getting the right permissions for the copied files too?

Last edited by scar (2014-12-28 08:57:36)


“The future has already arrived. It's just not evenly distributed yet.”
― William Gibson

Offline

#2 2014-12-27 13:56:53

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: Locally shared folder - permissions problem [SOLVED]

How do you copy files?


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

#3 2014-12-27 14:05:32

Lone_Wolf
Forum Moderator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,952

Re: Locally shared folder - permissions problem [SOLVED]

I'm 99% sure default setting for copy is to preserve attributes like those.

Some filemanagers (like midnight commander) allow you to change that setting.

Some alternatives :
- use cp --no-preserve=mode,ownership <something> .
That is supposed to use the default attributes for the destination folder/file when copying, check cp manpage for details.
to make it easy for users to use, you could create an alias for it.

- use chown / chmod commands after copying


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#4 2014-12-27 16:05:23

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: Locally shared folder - permissions problem [SOLVED]

Lone_Wolf wrote:

- use chown / chmod commands after copying

autochown was designed for this scenario.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#5 2014-12-27 17:49:50

scar
Member
From: Hungary
Registered: 2009-10-01
Posts: 442

Re: Locally shared folder - permissions problem [SOLVED]

We copy files using a file manager (thunar).
CLI cannot be an option, as my users do not know anything about it. And I'm fine with it.
I'm a bit tired, but tomorrow I'll try autochown.


“The future has already arrived. It's just not evenly distributed yet.”
― William Gibson

Offline

#6 2014-12-28 08:57:18

scar
Member
From: Hungary
Registered: 2009-10-01
Posts: 442

Re: Locally shared folder - permissions problem [SOLVED]

Autochown seems to work for me, thank you (by the way, it is really cool...)

Thank you, guys


“The future has already arrived. It's just not evenly distributed yet.”
― William Gibson

Offline

#7 2014-12-28 14:01:29

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: Locally shared folder - permissions problem [SOLVED]

scar wrote:

Autochown seems to work for me, thank you (by the way, it is really cool...)

Thank you, guys

big_smile


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

Board footer

Powered by FluxBB