I have created a folder, /hello: it has the following permissions:Owner = rwxGroup = rwxOthers = rand the folder is owned by john and belongs to the group sales. I have created another user named david and added him to the group sales.Currently, the files created by john are:Owner = rwGroup = rwOthers = rand files created by david are:Owner = rwGroup = rOthers = rI do not want files created by john to have write permissions granted by default to the sales group.I have tried changing the permissions and it resulted in david not being able to write into the directory.
Create permissions for group to write and files created by owner are only writeable by owner
permissions;filesystems
First, concerning the read permission for Others on /hello, you probably want either no read permission at all, or you want Read and Execute permission on /hello. Execute permission on a directory means the user can do an ls in the directory.  Read without Exec permission means that the other user would be able to read any file in that directory, but only if they knew the name of the file.  It's rare that this is desired.Second, if files are created by John are always readable by others, then, you can't stop David from reading them.You can set the default permissions a user creates files as using the umask command.  Put this line in John and David's .bashrc (or equivalent):umask 7Now, when John creates files in /hello, they will be owner and group of john.  -rw-rw---- 1 john  john  0 Jun 28 22:05 fooDavid will not be able to read this file.Another possibility is, instead of using a group names sales, simply add john to David's group.  John will then be able to read/write David's files but not the other way around.Some other interesting things you might consider.  You can set the gid flag on the /hello directory and then when files are created by either John or David, they will be in the sales group.  Hence readable and writable by both.  Not what you asked for, but this is how you do that.