1
    user@user-ubuntu:/usr/workspace$ whoami
user
user@user-ubuntu:/usr/workspace$ sudo ls -ltrah .
total 8.0K
drwxr-xr-x 15 root root 4.0K Sep  2 20:10 ..
drwxrwx---  2 root fooo 4.0K Sep  9 13:28 .
user@user-ubuntu:/usr/workspace$ git clone https://github.com/nkrishnawat/fooo-backend.git
fatal: could not create work tree dir 'fooo-backend': Permission denied



less /etc/groups -tail
nvidia-persistenced:x:137:
citrixlog:x:1001:
fooo:x:1002:user
user204069
  • 111
  • 1
  • 3
    Has the user logged out and back in since the account was added to the group? – Sotto Voce Sep 09 '23 at 20:51
  • Dont permission work instantaneously ? I have never seen logout/logback for permissions. – user204069 Sep 09 '23 at 21:02
  • Also I am not sure why I am getting authentication failure for:user@user-ubuntu:/usr/workspace/fooo-backend$ su root Password: su: Authentication failure – user204069 Sep 09 '23 at 21:05
  • 1
    Permissions on a filesystem change immediately, yes. But the group membership of running processes (like the user's shell) don't necessarily change as soon as the /etc/group file is changed. – Sotto Voce Sep 09 '23 at 21:07
  • The su command prompts for the password of the account whose permissions you are requesting (in this case, the root password). Are you entering the root password or your own account password? sudo is the command that prompts you for your account password in order to gain another account's privileges. – Sotto Voce Sep 09 '23 at 21:10
  • wrt, root access: I was able to change root password: sudo -i passwd – user204069 Sep 09 '23 at 21:10
  • How do I log out/login, You mean log out of system, of terminte the shell and open new terminal ? – user204069 Sep 09 '23 at 21:11
  • Completely log out of the system, @user204069 – Chris Davies Sep 09 '23 at 21:19
  • @SottoVoce, the group memberships of running processes don't change through the modification of some file, period. – ilkkachu Sep 10 '23 at 12:17
  • @ikkachu I'm not sure what statement of mine you're contradicting. – Sotto Voce Sep 10 '23 at 12:28

1 Answers1

1

You report that when user attempts $ mkdir /usr/workspace/baz they are greeted with "Permission denied".

If you run $ id you will notice that group "fooo" does not appear in the output. The contents of /etc/group are consulted at login time, and will contribute to that id output.

Log out, log back in, verify the id output looks good, and attempt the mkdir once more, seeing it succeed.

J_H
  • 866