Setting up a Share Without Authentication: Difference between revisions
From SambaWiki
Mmuehlfeld (talk | contribs) (Refreshed page content. Made it more general.) |
|||
Line 1: | Line 1: | ||
In some scenarios, expecially on standalone servers, it might be a requirement, to provide a share, that is accessable without authentication (anonymous access). |
|||
= Anonymous Read-Only Share = |
|||
Two smb.conf directives are required in the [global] section, to allow anonymous access on shares in the later step: |
|||
The following /etc/samba/smb.conf file shows an example how to configure a read-only file share with guest access. Two directives are used to configure guest access – <map to guest = Bad user> and <guest account = nobody>. |
|||
⚫ | |||
/etc/samba/smb.conf: |
|||
workgroup = MYWORKGROUP ## Keep this two lines on their current |
|||
<pre> |
|||
security = user ## value, if you're doing this on an |
|||
⚫ | |||
workgroup = SAMBA |
|||
security = user |
|||
map to guest = Bad user |
map to guest = Bad user |
||
⚫ | |||
[data] |
|||
comment = Anonymous Samba Share |
|||
path = /samba/anon_share |
|||
read only = yes |
|||
⚫ | |||
</pre> |
|||
For the share, that should be accessable without login, use the following configuration: |
|||
= Anonymous Read-Write Share = |
|||
/etc/samba/smb.conf: |
|||
<pre> |
|||
[global] |
|||
workgroup = SAMBA |
|||
security = user |
|||
map to guest = Bad user |
|||
[MyShare] |
|||
[data] |
|||
comment = Anonymous Samba Share |
comment = Anonymous Samba Share |
||
path = /samba/ |
path = /srv/samba/anonymous_share/ |
||
guest ok = yes |
guest ok = yes |
||
read only = yes|no |
|||
# Optionally you can map the anonymous user to a local user/group, if necessary. |
|||
force user = myuser |
force user = myuser |
||
force group = mygroup |
force group = mygroup |
||
</pre> |
Revision as of 18:52, 26 August 2015
In some scenarios, expecially on standalone servers, it might be a requirement, to provide a share, that is accessable without authentication (anonymous access).
Two smb.conf directives are required in the [global] section, to allow anonymous access on shares in the later step:
[global] workgroup = MYWORKGROUP ## Keep this two lines on their current security = user ## value, if you're doing this on an map to guest = Bad user guest account = nobody
For the share, that should be accessable without login, use the following configuration:
[MyShare] comment = Anonymous Samba Share path = /srv/samba/anonymous_share/ guest ok = yes read only = yes|no # Optionally you can map the anonymous user to a local user/group, if necessary. force user = myuser force group = mygroup