I am running Ubuntu 10.04 server and am having some very counter-intuitive experiences with users/groups. For example:
# create empty file
sudo touch test_file
# create 'test' group
sudo groupadd test
# change group of file to 'test'
sudo chown root:test test_file
# give write permissions to group
sudo chmod g+rwx test_file
# add my user to 'test' group
sudo usermod -a -G test {my-user}
# touch the file as my current user
touch test_file
The last line produces a permissions error, however I have ensured that my user is part of the 'test' group (groups {my-user} confirms this). The group of test_file is also definitely set to 'test' and the group permissions are set. What am I missing?