I decided to make my home server an Ubuntu Desktop machine. After searching online, I installed Samba and connected my other Windows pc with my Ubuntu desktop.

When I shared files from the server to my PC, I had permissions errors. After looking around, I found that a chmod 777 on my media folder (movies and series) unlocked it.

Since then, I searched a bit more about the permissions (777 in particular) and I realized that this opened the read write and execute options for everyone.

My question is whether 'everyone' specifies the people on my network, i.e. me and my wife, which would be no fuss for me because I know she won't mess up anything, or if 'everyone' goes out to EVERYONE, hence I have opened Pandora's box and I need to shut it off fast.

If the second is the case how do revoke the chmod 777 on that folder without causing any harm?


Everyone means everyone that is able to visit your system from walking up to the machine to anyone outside on the internet visiting a website you host, or ssh tunnel you set up to your system. Or abuse a backdoor in your router (Netgear, NMX300 as an example).

The way to revoke it is by executing the same command with less privileges. In general "750" for directories and "640" for files can be enough. You can combine the "chmod" with a "find" so you can alter these settings based on if it is a file or a directory.

You issue these 2 commands from the directory where you need to change anything below that directory:

find . -type f -exec chmod 640 {} \;
find . -type d -exec chmod 750 {} \;

(-type f is for files, type d is for directories)


"Everyone" means code running as any user on your machine both human users and server daemons.

Most server daemons have access controls of their own. So making something 777 doesn't generally open it to the whole world but what it does mean is you lose defense in depth. If you are (for example) running a webserver and the web server has a security flaw they can read and write your files.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.