Public Samba Server: Difference between revisions
(give posix perm example) |
(change share to public and location to /public_data) |
||
Line 1: | Line 1: | ||
In some situations, it is valuable to have unauthenticated access to a Samba server, where the username and password supplied by the client is ignored. |
In some situations, it is valuable to have unauthenticated access to a Samba server, where the username and password supplied by the client is ignored. |
||
To share (for example) / |
To share (for example) /public_data on a Samba server first create an smb.conf with: |
||
[globals] |
[globals] |
||
map to guest = bad user |
map to guest = bad user |
||
[ |
[public] |
||
path = / |
path = /public_data |
||
guest ok = yes |
guest ok = yes |
||
To allow write access to the share change it to: |
To allow write access to the share change it to: |
||
[ |
[public] |
||
path = / |
path = /public_data |
||
guest ok = yes |
guest ok = yes |
||
read only = no |
read only = no |
||
Line 20: | Line 20: | ||
For example, you may wish to give world read access with: |
For example, you may wish to give world read access with: |
||
chmod -R a+rX / |
chmod -R a+rX /public_data |
||
To change the guest account, set: |
To change the guest account, set: |
||
Line 32: | Line 32: | ||
To test access to the share will work regardless of username specified by the client, run: |
To test access to the share will work regardless of username specified by the client, run: |
||
smbclient //server/ |
smbclient //server/public -Unot_a_user%foo |
||
smb> ls |
smb> ls |
||
smb> get file |
smb> get file |
||
(where file is a file in / |
(where file is a file in /public_data) |
Revision as of 04:01, 1 March 2012
In some situations, it is valuable to have unauthenticated access to a Samba server, where the username and password supplied by the client is ignored.
To share (for example) /public_data on a Samba server first create an smb.conf with:
[globals] map to guest = bad user
[public] path = /public_data guest ok = yes
To allow write access to the share change it to:
[public] path = /public_data guest ok = yes read only = no
Finally, ensure that the Samba guest account (typcially nobody) has the posix permissions to read and write (as appropriate) /data on your server's file system.
For example, you may wish to give world read access with:
chmod -R a+rX /public_data
To change the guest account, set:
[globals] guest account = samba_guest map to guest = bad user
This configuration will still permit authentication - any user in your Samba password database (passdb.tdb, smbpasswd etc) can still authenticate, as long as the username is correct.
To test access to the share will work regardless of username specified by the client, run:
smbclient //server/public -Unot_a_user%foo smb> ls smb> get file
(where file is a file in /public_data)