2

Given a directory DirA (directory owner is root and group is sys).
Given a user userA, user belongs to group sys, he should be able to make a sub directory inside DirA ?

on Solaris SunOS 5.9 I have a directory /opt:

bash-2.05$ ls -la /
total 1205
drwxr-xr-x  34 root     root        1024 Mar 17 04:21 .
drwxr-xr-x  34 root     root        1024 Mar 17 04:21 ..
.. Removed all..
lrwxrwxrwx   1 root     other         16 Apr 14  2008 opt -> /export/home/opt

This symbolic link takes me to:

bash-2.05$ ls -la /export/home
total 524638
drwxr-xr-x  31 root     root        1024 Jan 25  2015 .
drwxr-xr-x   3 root     sys          512 Jul  2  2007 ..
...REMOVED...
drwxr-xr-x  12 root     sys          512 Apr 24 10:29 opt

I am logged in with user builder:

bash-2.05$ /usr/ucb/whoami
builder

And he belongs to groups:

bash-2.05$ groups builder
other root sys 
bash-2.05$

So why mkdir fails in /opt/?

bash-2.05$ cd /opt/
bash-2.05$ pwd
/opt
bash-2.05$ mkdir mynewdir
mkdir: Failed to make directory "mynewdir"; Permission denied
bash-2.05$ cd /export/home/opt/
bash-2.05$ mkdir mynewdir
mkdir: Failed to make directory "mynewdir"; Permission denied
bash-2.05$
1
  • The group permissions rwxr-xr-x are not permitting to create a dir. for the user.
    – user218374
    Commented Apr 24, 2017 at 8:51

1 Answer 1

5
drwxr-xr-x  12 root     sys          512 Apr 24 10:29 opt

means that the directory is only writable for root. For sys group members to be able to make changes to the directory (including creating subdirectories), it needs to be

drwxrwxr-x  12 root     sys          512 Apr 24 10:29 opt

If you want to enable this:

chmod g+w opt

will make the appropriate change.

0

You must log in to answer this question.

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