Do permissions take time to take effect?

Dan Nelson dnelson at allantgroup.com
Wed Nov 18 15:21:58 UTC 2009


In the last episode (Nov 17), James Phillips said:
> I wanted to create a shared directory writable by all users. When it
> initially failed, I assumed there may be a blanket ban on writing to
> directories owned by root.  Today, I was able to write to the root-owned
> "Share" directory.  However, when I re-created the directory owned by a
> special-purpose "Share" user, I ran into the same problem again.
> 
> $ cd
> $ pwd
> /home/james
> $ cd /home/Share
> $ ls -la
> total 4
> drwxrwxr-x  2 root  users  512 Nov 14 09:39 .
> drwxr-xr-x  5 root  wheel  512 Nov 14 09:39 ..
> $ grep users /etc/group
> users:*:100:james,backup
> $ cat > test.txt
> What? now it worked?

You are probably in the "users" group.  Running either the "groups" or "id"
command will say for sure.

> $ ls
> test.txt
> $ rm test.txt
> 
> ***After creating a special "Share" user***
> 
> $ cd /home/Share
> $ ls -la
> total 4
> drwxrwxr-x  2 Share  Share  512 Nov 17 21:04 .
> drwxr-xr-x  5 root   wheel  512 Nov 17 21:04 ..
> $ cat > test.txt
> cannot create test.txt: Permission denied
> $ grep Share /etc/group
> Share:*:1003:james,backup
> $

If you are currently either the "james" or "backup" user, and added the
Share group membership on another tty, then you may need to log out and back
in for the system to assign your new group membership to your session. 
Filesystem permissions take effect immediately, but group memberships are
assigned once, at login.
 
-- 
	Dan Nelson
	dnelson at allantgroup.com


More information about the freebsd-questions mailing list