Score:0

ACL settings works when using ssh but not with scp command

us flag

I have setup an Arch Linux machine with a user 'archie' with a primary group 'users' as:

useradd -m -g users archie

Whenever archie creates a file in his ~/shared directory I want the group users to get write permissions so I add:

setfacl -dm u::rw,g::rw,o::r ~/shared

Now when I'm logged in as archie via ssh and create a file in ~/shared I can see that it works:

touch a.txt
ls -l
-rw-rw-r--+ 1 archie users 0 Dec  6 20:05 a.txt

However when I use scp from my client the 'w' permission is not set to users i.e.:

scp a.txt [email protected]:/home/archie/shared
# now group users only got read permissions:
ls -l
-rw-r-r--+ 1 archie users 0 Dec  6 20:07 a.txt

I have no clue why I get this behaviour, shouldn't scp kind of works the same way as being logged in with ssh? How can I configure so I get the same behaviour with scp?

John Greene avatar
cn flag
Reminds me of https://bugzilla.mindrot.org/show_bug.cgi?id=2678
Score:0
bm flag

I also could not get this to work with ACLs, but for me bindfs was the solution - it works no matter if you are logged in via SSH or use scp to copy files there.

sudo bindfs --create-for-group=users --create-with-perms=u+rwX,g+rwX,o+rX /home/archie/shared /home/archie/shared

Or in /etc/fstab this would look like:

/home/archie/shared /home/archie/shared fuse.bindfs create-for-group=users,create-with-perms=u+rwX,g+rwX,o+rX 0 0

See also Forcing user in both directions using bindfs

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.