1

I have created a folder /home/public to share files amongst all my users in my computer. I also have created a group public.

I've recursively changed the group owner to public and changed group permissions to rwxbut I still can not access files that do not belong to the user.

Any idea as to why?

EDIT:

gamer@pop-os:~$ id
uid=1002(gamer) gid=1002(gamer) groups=1002(gamer),1003(public)

gamer@pop-os:~$ ls -ld /home/public
drwxrwsr-x 4 root public 4096 Nov 16 11:41 /home/public

I can open the file below:

gamer@pop-os:/home/public/ASIR/Implantación de sistemas operativos/Unidad 3 - Administración de software base I$ ls -ld Configuraciones\ básicas\ SO.pdf
-rw-rwxr-- 1 john public 775221 Nov  9 13:24 'Configuraciones básicas SO.pdf'

I can not open this other file that is in the same folder:

gamer@pop-os:/home/public/ASIR/Implantación de sistemas operativos/Unidad 3 - Administración de software base I$ ls -ld ISO\ -\ UD3\ -\ Administración\ de\ software\ base\ I 
-rw-rwxr-- 1 john public 1809748 Nov  3 11:46 'ISO - UD3 - Administración de software base I'

EDIT 2:

enter image description here

13
  • 3
    Please edit your question and add the output of the commands ls -ld /home/public, ls -ld /home/public/a_file_you _cannot_access and id executed as the user that has the problem.
    – Bodo
    Nov 16, 2020 at 11:27
  • If owner permissions denies the owner access, group permissions will not grant the owner access.
    – Kusalananda
    Nov 16, 2020 at 11:29
  • Please use set the setgid on the folder: chmod g+s /home/public to make all new files in that folder have the correct group id.
    – Ned64
    Nov 16, 2020 at 11:34
  • What is the exact error message you get when you try to open the file?
    – Kusalananda
    Nov 16, 2020 at 11:38
  • 2
    I wonder if it has anything to do with the lack of a filename suffix. If it's a PDF file, try giving the file a name that ends with .pdf. I don't know what your file manager tries to do when you double-click a file with no filename suffix. It may try to execute it.
    – Kusalananda
    Nov 16, 2020 at 12:00

1 Answer 1

0

Suppose we have two users test1 (gid=public) tets2(gid=public) :

Make sure to execute the above :

# Create public dir & group
mkdir /home/public
groupadd public
# Set the ownership / permissions 
chown root:public /home/public
chmod 770 /home/public
# Create the users
useradd -m -g public test1
useradd -m -g public test2
# Set the password for oth users
echo "test1:test1" | chpasswd
echo "test2:test2" | chpasswd
# TEST
ssh test1@<ip>
    cd /home/public/ : OK
    touch /home/public/test.txt : OK
ssh test2@<ip>
    cd /home/public/ : permission denied
    touch /home/public/test.txt : permission denied

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .