The "x" bit needs to be set for directories to be able to access files inside or cd into it.
Change the permissions to 777. The sticky bit is correct.
sudo chmod ugo=rwxt <directory>
You had also used sgid on the directory. That will cause files created there to inherit the gid of the directory. Is that what you want to do?
The sticky bit as you know protects a file from deletion when another user has write access to the directory. However to fully protect a file from being zeroed or altered by a non-owner, the person who creates the file needs to clear the group and other write bit. If a users umask value is 0022, then that is how the file will be created.
You might be a bit confused what 0664 permissions on a file in the directory means. Creating or deleting a file removes an entry from the directory, which from the kernel's point of view is just a file. So it is the permissions of the directory that determines whether you can create a file in that directory. When I change my umask value to 000 and touch a file in /tmp/, it is created with 666 permissions. The /tmp directory has rwx permissions for everyone and the sticky bit set, the same as the permissions as the directory you want.
Last edited by jschiwal; 05-22-2008 at 05:17 AM.