chmod 777 on a home network

6,101

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 1.5.0.11 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)

Share:
6,101

Related videos on Youtube

madnick
Author by

madnick

Updated on September 18, 2022

Comments

  • madnick
    madnick over 1 year

    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?