Set default file permissions and become file owner

  • Hi,


    in the process of setting up my NAS I copied a lot of data from different sources into shared folders. Some of these files I copied as root. So now the file owner is root and I cant write on these files in samba shares. Other files have permission settings like 0777. I want to reset the permissions in all of my shared folders and I want to become owner of these files so that I can use them in samba shares.


    Before I actually do this, I'd like to ask if this is the proper way or if I am missing something here...?

    Code
    find . -type d -exec chmod 775 {} \;
    find . -type f -exec chmod 664 {} \;
    chown -R <userName>:users .


    Best,
    Aiakos

  • Erm, if you have the omvextrasorg Plugin installed you'd actually have a tab called reset permissions under the shared folder section that will do everything you need with the only exception that it doesn't chown to a specific user.


    Greetings
    David

    "Well... lately this forum has become support for everything except omv" [...] "And is like someone is banning Google from their browsers"


    Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.

    Upload Logfile via WebGUI/CLI
    #openmediavault on freenode IRC | German & English | GMT+1
    Absolutely no Support via PM!

  • You might want to put in the path to be exact and you can do adjust files/folders in same command:
    find /media/UUID/{path to folder} \( -type f -exec chmod 644 {} \; \) , \( -type d -exec chmod 755 {} \; \)


    With the chown you can be one level above the folder you want to chown, you should be able to list it with "ls -la" and then:
    chown -R <user>:<group> <foldername>


    e.g. chown -R matt:users documents


    With SAMBA the owner (matt) should be user that has write privileges to the share. The user that you want to be able copy/delete files from the share.

  • I do manually all the time.


    Thats fine, but let's be honest, we shouldn't advise the users to do this unless we want them to mess up their systems (considering we have a GUI option for that), should we?


    Greetings
    David

    "Well... lately this forum has become support for everything except omv" [...] "And is like someone is banning Google from their browsers"


    Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.

    Upload Logfile via WebGUI/CLI
    #openmediavault on freenode IRC | German & English | GMT+1
    Absolutely no Support via PM!

  • Just don't want to have the next Guy coming in with that question executing those commands at / ;)


    Greetings
    David

    "Well... lately this forum has become support for everything except omv" [...] "And is like someone is banning Google from their browsers"


    Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.

    Upload Logfile via WebGUI/CLI
    #openmediavault on freenode IRC | German & English | GMT+1
    Absolutely no Support via PM!

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!