I might be getting this groups thing completely wrong but this is what i was trying to do.

Created new Ubuntu 17.4 desktop installation in virtual box.

When installing added user 'administrator'.

When installed went to terminal and 'useradd' two new users: 'dubac' & 'mali'.

Created their /home/user dirs and sudo chown them to those users.

administrator@administrator-VirtualBox:~$ groups
administrator adm cdrom sudo dip plugdev lpadmin sambashare dubac
administrator@administrator-VirtualBox:~$ cd ..
administrator@administrator-VirtualBox:/home$ ls -l
total 12
drwxrw---- 21 administrator administrator 4096 Svi 29 14:35 administrator
drwxrw----  3 dubac         dubac         4096 Svi 29 13:49 dubac
drwxr-xr-x  2 mali          mali          4096 Svi 29 14:20 mali
administrator@administrator-VirtualBox:/home$ cd dubac
bash: cd: dubac: Permission denied

I have restarted the virtual pc several times.

Why can't I access the 'dubac' user dir when I (administrator) have a supplementary group dubac on the list?


The permissions on folder dubac are:

drwxrw----  3 dubac         dubac         4096 Svi 29 13:49 dubac
  • dubac user has permissions rwx
  • dubac group has permissions rw
  • other has no permission

In order to cd into a directory you need the x permission (also known as execution)

Since you aren't the dubac user, you need to have the x permission on the group or other sections. But none of them has the x permission.

Running sudo chmod g+x /home/dubac will add the x permission to the dubac group and will allow you to cd inside /home/dubac folder

  • 2
    That's it. After about 20 videos and 20 pages on linux file permissions i needed you to tell me that execute is needed for switching directories. Thank you, sir! – user1941235 May 29 '17 at 13:06
  • @user1941235 - happy to help :) – Yaron May 29 '17 at 13:08

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.