5

I wanted to make a share folder for my parents.

I created a system user with adduser, created a home folder which I wanted to use as a share folder. The name of this folder is share, the name of the user is shareacc and made my parents and me belong to that group. So it happened that the folder in /home/share does not belong to shareacc. So I used

chown -c shareacc:shareacc /home/share

and it looks like the home folder still not belong to this group and/or user. But if I look this up as root with nautilus it says me it does belong to this group. See Image. Left Root, right is normal.

Screenshot including properties

How can this be fixed or what am I doing wrong?

The output of ls -la in /home is

/home$ ls -la
insgesamt 28
drwxr-xr-x  7 root            root     4096 Dez  3 12:16 .
drwxr-xr-x 24 root            root     4096 Nov 23 17:20 ..
drwxr-x--- 42 cornelius-admin sudo     4096 Dez  3 12:09 cornelius-admin
drwx------ 29 dorothea        dorothea 4096 Nov 28 18:39 dorothea
drwxrwxr-x  3 root            root     4096 Sep  8 21:12 .ecryptfs
drwxr-xr-x 20 paul            paul     4096 Nov 28 13:34 paul
drwxr-xr-x  2 shareacc        shareacc 4096 Dez  3 12:16 share

and the output of the command in the folder itself is

/home/share$ ls -la
insgesamt 8
drwxr-xr-x 2 shareacc shareacc 4096 Dez  3 12:16 .
drwxr-xr-x 7 root     root     4096 Dez  3 12:16 ..
  • Can you print the output of ls -la on that directory? – mattias Dec 3 '17 at 11:57
  • Here you are. I put it in the question itself. – Booming Dec 3 '17 at 12:04
6

If you want other system users that are part of the shareacc group to be able to write to /home/share you need to make it writable,

chmod -R 775 /home/shareacc

Note: -R makes the chmod 775 recursive, i.e all files & sub-directories within /home/shareacc will be 775 as well.

It can also be achieved with,

chmod g+w /home/shareacc

That will give user rwx, group rwx, and others r-x.

http://www.thegeekstuff.com/2010/06/chmod-command-examples/

| improve this answer | |
  • 1
    Thank you, that worked. But how did it knew that I wanted to make it rw for this group? – Booming Dec 3 '17 at 12:50
  • 1
    How what knew that? You instructed the computer, with the help of chmod, to assign those permissions :) – mattias Dec 3 '17 at 12:51
  • 1
    @Booming The owner of the directory was the intended user. The group was the intended group. All chmod did was say "the user assigned to this directory can do these things and members of the group assigned to this directory can do those things and everyone else can do the other things.". It didn't need to know the group and user because they were already assigned to the directory; if you changed the owner and group it would change which owner and group got those permissions. – wizzwizz4 Dec 3 '17 at 14:14
  • 1
    Why did you use the -R flag here? That is generally bad advice, and should come with a warning, since the -R flag to chmod is the cause of so much woe... – Zanna Dec 3 '17 at 15:37
  • @Zanna As OP wants to share that entire directory, my thought was that there might already be directories within it that needs to be chmodded as well. But I get your point, I'll put a note about it in the answer. – mattias Dec 3 '17 at 16:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.