What is the difference between setting permissions chmod 777 and chmod 1777 ?

by
Share this Article: Facebook0Google+0Twitter0LinkedIn0Reddit0StumbleUpon0

Question : What is the difference between setting permissions chmod 777 and chmod 1777 ?terminal

 

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.

For questions please refer to our Q/A forum at : http://ask.unixmen.com/


Share this Article: Facebook0Google+0Twitter0LinkedIn0Reddit0StumbleUpon0