Ubuntu – How to allow Windows pc to modify Linux files over Samba server without allowing full 777 access

permissionssambawindows

I recently set up Samba on a Linux server and discovered the shared drive on a Windows machine with ease, but was not able to copy files to that drive as it would ask for extra permissions.

I was able to write to sub-folders with 777 permissions, but the main drive had 775.

As i am advised that 777 permissions are highly un-secure, how can I modify groups to include users browsing in from Windows who do not have user-level permissions in the Linux server?

This is a home network, and access to the Samba server is limited through a global setting that prevents access from outside the network (by adding the following lines to /etc/samba/smb.conf)

[global]
hosts allow = 192.168.0.
hosts deny = ALL

Therefore I am not concerned about security within the network – if a user is on the 192.168.0.x subnet I am happy to assume that they are legitimate and do not want to add further authentication steps at the moment.

Best Answer

Typically one doesn't want to give everyone with network access write access to a directory. There often better solutions to share files among a user group, e. g. giving everybody their own network share with (partial) read access for everybody else. That's where the recommendation to not use world-writable access permissions comes from.

However, in your case that seems to be exactly what you want. So go ahead and use chmod -R 0777 /path/to/share along with appropriate Samba configuration entries like writable = yes.