LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Setting a directory permission (https://www.linuxquestions.org/questions/linux-server-73/setting-a-directory-permission-939559/)

hewittrj 04-12-2012 09:12 PM

Setting a directory permission
 
i think I got samba working on my Ubuntu server 11.4
My windows pc see the share directory but I think I need to change the dir permission.
what cli do I use to make the dir
/home/storage able to let anybody write and read to it.



Robert

TommyC7 04-12-2012 10:35 PM

mkdir to make the directory

chmod to modify it's permissions but if you want the people using Windows shares to read/write to it you would need to modify the share on samba's end by editing /etc/smb.conf. Very helpful guides can be found on http://www.samba.org/ for that.

centos123 04-13-2012 05:06 AM

edit the file smb.conf and put the permission and access level of share file/folder ..

hewittrj 04-13-2012 01:03 PM

I added the following lines to the smb.conf at the end
[storage]
Comment = storage
Writable = yes
Path = /home/storage

After adding this and resetting the smb service all windows systems would see the available storage dir in the network neighborhood but when I try to ve a file to it from said systems I would get a warning that I had not te permission what do I need to do now.

I used the command
sudo midair /home/storage
To treate the dir on the system

jschiwal 04-13-2012 01:29 PM

The directoty should be rwx for all with the sticky bit set.

#> sudo chmod a=rwxt /home/storage/

hewittrj 04-13-2012 04:18 PM

It works I am able to access it from ny pc in my home. For now it will do I am not worried abou dir privacy as I am placing it in a small school and only for teachers to story school related fles on it.

Satyaveer Arya 04-13-2012 05:04 PM

hewittrj,

I think, if you would have given 744 permission to /home/storage directory, that would have also worked for you.

jschiwal 04-13-2012 08:35 PM

The permissions of the directory being shared will not allow "anybody" to save files in it with 0755 permissions.
If you want users who are teachers to be able to access it, create users for them on the samba server:
sudo smbpasswd -a <username>

Create a 'teachers' group. Change the group ownership of the directory to teachers'.
Change the permissions to ug=rwx,o=rxt
Now users who aren't owners, and not members of the `teachers' group will have read access but not write access.

It the permissions of a directory are stricter than the samba permissions, you will have the lesser permissions.

The samba.org website has a good book: Samba 3 by Example. It will walk you, step by step, through setting up different types of samba shares, including creating the directories, setting permissions, and configuring smb.conf.

hewittrj 04-14-2012 01:55 PM

Right now creating users is not a priority ESP as the teachers may different by the time I get the system in place


All times are GMT -5. The time now is 09:09 AM.