Minimal samba
Install Samba
apt-get install samba
Samba configuration file is located in /etc/samba/smb.conf, create a backup file before to make changes to it
[name_of_shared_folder]
path= /path/to/share
read only = no
browsable = yes
writeable = yes
guest ok = yes
# Additional force parameters
force create mode = 0660 force directory mode = 2770 force user = demoUser # Or use nobody force group = demoGroup
create mask = 0755
Hash (#) or a semicolon ( ; ) are equivalent to insert comments
After made your changes you have to restart Samba service to activate
service smbd restart
You can create a secure folder setting up a user for a specific folder using command smbpassword with option -a username to add user
smbpasswd [options]
options:
-L local mode (must be first option)
-h print this usage message
-s use stdin for password prompt
-c smb.conf file Use the given path to the smb.conf file
-D LEVEL debug level
-r MACHINE remote machine
-U USER remote username
extra options when run by root or in local mode:
-a add user
-d disable user
-e enable user
-i interdomain trust account
-m machine trust account
-n set no password
-W use stdin ldap admin password
-w PASSWORD ldap admin password
-x delete user
-R ORDER name resolve order
After setup the user for that folder you have to setup this option in the smb.conf file
valid users = @smbgrp
Access Samba from Windows
\\ip_address
This should allow to see the shared directory in windows explorer
Access Samba from Linux
Open file browser and search for "Open Location"
If you don't see the network shared directory you can digit
smb://<servername>/<sharename>
in the Location field
Alternatively you can install smbclient
apt-get install smbclient
And access by command line
smbclient //<hostname>/<sharename> -U <username>
To mount the shared directory you have to give this command as root
mount -t cifs -o <username>,<password> //<servername>/<sharename> /mnt/point/