Samba is an Open Source/Free Software suite that provides seamless file and print services to SMB/CIFS clients. Samba is freely available, unlike other SMB/CIFS implementations, and allows for interoperability between Linux/Unix servers and Windows-based clients.
SMB, which stands for Server Message Block, is a protocol for sharing files, printers, serial ports, and communications abstractions such as named pipes and mailslots between computer
Anonymous Samba Sharing
Ubuntu SAMBA Server
1. Install the samba with the anonymous sharing
apt-get install samba samba-common python-glade2 system-config-samba
2. Configure samba edit the file /etc/samba/smb.cnf
3. Before making changes take backup of original file mv /etc/samba/smb.cnf /etc/samba/smb.cnf.bak
4. Edit /etc/samba/smb.cnf
vi /etc/samba/smb.cnf
[global]
workgroup = WORKGROUP
server string = Samba Server %v
netbios name = ubuntu
security = user
map to guest = bad user
dns proxy = no
#============================ Share Definitions ==============================
[Anonymous]
path = /var/samba/anonymous
browsable =yes
writable = yes
guest ok = yes
workgroup = WORKGROUP
server string = Samba Server %v
netbios name = ubuntu
security = user
map to guest = bad user
dns proxy = no
#============================ Share Definitions ==============================
[Anonymous]
path = /var/samba/anonymous
browsable =yes
writable = yes
guest ok = yes
5. Create directory for Sharing Location
mkdir -p /var/samba/anonymous
6. Restart the Samba services to enable the new configuration:
service smbd restart
service nmbd restart
Client Windows Machine
From windows machine just browse the folder & try to create a text file, but you will get an error of permission denied.
In Run :- \\SAMBA Server IP
Modified the Permissions in Samba Server
1. Check the permission for the shared folder.
root@server1:~# ls -l /var/samba/anonymous
total 4
total 4
drwxr-xr-x 2 root root 4096 May 27 18:17 anonymous
2. Allow anonymous user give the permissions as follows;
root@server1:~# cd /var/samba/
root@server1:/var/samba# chmod -R 0755 anonymous/
root@server1:# chown -R nobody:nogroup anonymous/
root@server1:/var/samba# ls -l
total 4
drwx-xr-x 2 nobody nogroup root 4096 May 27 18:17 anonymous
Additional Notes:- Normally In smb.conf we have append the following details: Eg:-
[share]
comment = Ubuntu File Server Share
path = /var/samba/jagan
browsable = yes
guest ok = yes
read only = no
create mask = 0755
comment = Ubuntu File Server Share
path = /var/samba/jagan
browsable = yes
guest ok = yes
read only = no
create mask = 0755
*******************************************************************************************************
comment: a short description of the share. Adjust to fit your needs.
path: the path to the directory to share.
browsable: enables Windows clients to browse the shared directory using Windows Explorer.
guest ok: allows clients to connect to the share without supplying a password.
read only: determines if the share is read only.Write privileges are allowed only when the value is no, as is seen in this example. If the value is yes, then access to the share is read only.
create mask: determines the permissions new files will have when created.
No comments:
Post a Comment