What is the difference between setting permissions chmod 777 and chmod 1777 ?
Question : What is the difference between setting permissions chmod 777 and chmod 1777 ?
Answer : In a machine with multiple users, Changing permissions to 777, everybody will be able to write and remove everybody’s files….. so is Not what is wanted.
The 1777 mode change makes sure that any user can write to the /directory, but cannot remove other user’s files from them. The latter is prohibited
by the so-called sticky bit, the highest bit (1) in the 1777 bit mask.
So is advised for example to set /tmp permissions to 1777 instead to 777, the same for /var/tmp.