Google Plus

How do I set permissions to Samba shares?

Written by Mel Kham on . Posted in Linux tutorials

What is samba?

Samba is essentially a TCP/IP file and print server for Microsoft Windows clients. In fact, it can support any SMB/CIFS-enabled client. One of Samba’s big strengths is that you can use it to blend your mix of Windows and Linux machines

together without requiring a separate Windows server. Samba includes support for Active Directory, unicode, new authentication and filename mangling systems, printing support, trust relationships, LDAP integration and loadable RPC modules.

How do I set permissions to Samba shares?

Samba Basic permissions are as follows (configuration file is smb.conf [/etc/samba/smb.conf]):

  • read only: This parameter controls whether an user has the ability to create or modify files within a share. This is default.
  • guest ok: Uf this parameter is set to yes, the users will have access to the share without having to enter a password. This can pose security risk.
  • writeable: Specifies users should have write access to the share.

You can create the share called secretfiles with read only permission

[secretfiles]
path = /usr/share/docs
read only = Yes

You can create the share called unixmendoc with write permission
[unixmendoc]
path = /home/shared/unixmendocs
writeable = Yes

You can also create a list of users to give write access to the share with write list option. For example allow vlademir and unixmen to write to the share called goldoc:
[goldoc]
path = /home/shared/goldoc
write list = vlademir unixmen

You can create a list of users to give read access to the share with read list option, , for example the folder name is “myfolder“, and the persons names names are unixmen and vlademir.

[myfolder]

path = /home/shared/myfolder

read list = unixmen vlademir

You can use following options

read list: This option accepts a list of usernames or a group as its value. Users will be given read-only access to the share.

valid users: You can make a share available to specific users. Usernames or group names can be passed on as its value.

invalid users: Users or groups listed will be denied access to this share.

Samba mask permission

It is also possible to specify samba default file creation permission using mask.

  • create mask: This option is set using an octal value when setting permissions for files.
  • directory mask: Directories must have the execute bit for proper access. Default parameter is 0755.

[salesdoc]
path = /home/shared/sales
write list = rocky sys
create mask = 0775

And is done !

Reference :

For questions please refer to our Q/A forum at : http://ask.unixmen.com

Mel Kham

Founder of Unixmen, Living in Amsterdam. Am working in my free time to help people to understand the Opensource and to explain them in easy way how to make the fist steps to the the light. Working day and night with my Co-founder Zinovsky to keep this website live even with less resources.
  • http://www.bestfinance-blog.com BattleJodi27

    If you are willing to buy a car, you would have to get the loan. Moreover, my sister usually uses a sba loan, which supposes to be really fast.

  • http://www.bestfinance-blog.com KarinaFletcher

    Following my investigation, millions of people all over the world get the business loans at different creditors. Hence, there’s good chances to find a small business loan in all countries.

  • http://www.bestfinance-blog.com CochranIlene28

    Some specialists argue that loan aid people to live the way they want, just because they can feel free to buy necessary things. Furthermore, some banks give auto loan for young and old people.

  • http://jackysan.info Jackysan Lombok

    Thanks for share…
    The information is very useful for me.

  • Glenn

    I installed Samba but when I try to run it it asks for the password then goes blank never loads.

  • http://www.facebook.com/profile.php?id=100000002495910 Iman Oldgeek

    I have been trying to be able to access Ubuntu shares from either Windows 7 or Windows XP with zero success. Samba has moved into a tie with GRUB for my most despised software.

Like us on Facebook

This week Top Posts

Write for us

Recent Comments

Edson Carlos

|

In debian no found. I need link download install in linux debian

jacky can

|

You can actually unzip your secret archive by leaving out the -t option, instead using:

unzip newPhoto.jpg

DragonFartOutLoud

|

it went to china.

DragonFartOutLoud

|

great review! i’ve been using it as my main OS since Beta 1 release. its been a awesome ride so far :)

jet li

|

i try the method, and i unzip the image contain zip secret, i dont find the file that i was hide, where it go? and how to open it? :s

 
IDG Tech Network
Copyright © 2008-2013 Unixmen.com .
Maintained by Anblik .