How can I mount a remote volume with 777 permissions for all users?

20,718

sudo mount -t cifs //192.168.1.8/share local_dir -o username=user,password=pass,umask=0777

Share:
20,718

Related videos on Youtube

Kalessin
Author by

Kalessin

Updated on September 18, 2022

Comments

  • Kalessin
    Kalessin over 1 year

    I want users to be able to upload files to a central file server via my PHP script. I mounted the file server's shared volume using this command:

    sudo mount -t cifs //192.168.1.8/share local_dir -o username=user,password=pass
    

    Whilst I could sudo chmod my way to write access, there are hundreds of directories which already exist:

    drwxr-xr-x 1 root root    0 2011-03-30 15:59 dir1
    drwxr-xr-x 1 root root    0 2011-04-04 16:27 dir2
    drwxr-xr-x 1 root root    0 2011-04-04 18:07 dir3
    drwxr-xr-x 1 root root    0 2011-04-06 13:41 dir4
    drwxr-xr-x 1 root root    0 2011-04-06 13:39 dir5
    ....etc
    

    I may need to create a new directory or move the uploaded file to an existing directory.

    Is there anything I can do to make this share writeable by any user? The only other solution I can think of is to have Apache run as root. I won't be doing that.

  • Kalessin
    Kalessin almost 13 years
    Thanks Jason, your answer pointed me in the direction of the solution. You probably would have given me the correct solution if I'd mentioned that the remote share is a Windows volume.