Rename and save the deault configuration file.Open an empty file for new configuration.
$sudo touch /etc/samba/smb.conf
$sudo gedit /etc/samba/smb.conf
Edit Samba configuration file smb.conf
[GLOBAL]
netbios name = TEST-SAMBA
server string =
workgroup = china.messefrankfurt.com
announce version = 5.0
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=8192 SO_SNDBUF=8192
interfaces = lo, eth0
bind interfaces only = true
passdb backend = tdbsam
security = user
null passwords = true
username map = /etc/samba/smbusers
name resolve order = hosts wins bcast
wins support = yes
printing = CUPS
printcap name = CUPS
syslog = 1
syslog only = yes
1. netbios name : domain name which is the same as configured in Windows.
2. wins support : If your box doesn't have a static ip-address, or you cannot configure your router/server to provide you with a fixed dhcp-lease, change this configuration parameter to "no". In this case you cannot use the benefits of WINS.
3. interfaces : To allow only wired network to have access and that the network card is called eth0.
[HOMES]
NOTE: If you need access to the user home directories, uncomment the lines below and adjust the settings to your hearts content.
;valid users = %S
;create mode = 0600
;directory mode = 0755
;browseable = no
;read only = no
;veto files = /*.{*}/.*/mail/bin/
[NETLOGON]
NOTE: Only needed if you run samba as a primary domain controller.
Not needed as this config doesn't cover that matter.
;path = /var/lib/samba/netlogon
;admin users = Administrator
;valid users = %U
;read only = no
[PROFILES]
NOTE: only needed if you're running a primary domain controller.
;path = /var/lib/samba/profiles
;valid users = %U
;create mode = 0600
;directory mode = 0700
;writeable = yes
;browseable = no
[DVD-ROM Drive]
Uncomment if you need to share your CD-/DVD-ROM Drive.
;path = /media/cdrom
;browseable = yes
;read only = yes
;guest ok = yes
printers sharing
NOTE: Inside this place you may build a printer driver repository for Windows.
path = /var/lib/samba/printers
browseable = yes
guest ok = yes
read only = yes
write list = root
create mask = 0777
directory mask = 0775
[printers]
path = /tmp
printable = yes
guest ok = yes
browseable = no
files sharing
This is the name of the share. Leave it as it is or adjust it to whatever you prefer. Don't use more than 31 characters and try to avoid spaces!
path = /home/samba/
browseable = yes
read only = no
guest ok = no
create mask = 0777
directory mask = 0755
In case you don't have an extra hard drive/partition you may also create folder.
To create the folder.
Add user and set password.
Enable user account.
NOTE: create Ubuntu account first before using the account as Samba account.
$sudo smbpasswd -L -a riverliu
$sudo smbpasswd -L -e riverliu
- Click "Control Panel"
- Click "Network Connections"
- Find your "LAN Connection"
- Right-click the icon and select "Properties"
- Select the "TCP/IP" Protocol and click the "Properties" button
- Click "Advanced"
- Select the third Tab entitled "WINS"
- Click "Add"
- Type in the ip-address of your Linux box
- Click "Add"
- Select "Use NetBIOS over TCP/IP"
- Click "OK"
- Click "OK"
- Click "OK"
- Reboot Windows
Upon reboot you may now map the network drive within Windows.
With WINS enabled:
- Right-click "My Computer"
- Select "Map network drive"
- Choose the drive letter
- Type \\
NOTE: Adjust this to the hostname and sharename you chose above!
- Click "Finish"
With WINS disabled:
- Right-click "My Computer"
- Select "Map network drive"
- Choose the drive letter
- Type \\
NOTE: To find out the ip-address of your Linux box type "ifconfig" inside a terminal and find the ip for the correct interface (i.e. eth0). Don't forget to adjust the sharename to the name you chose above.
- Click "Finish"
change files/folders ownership.
change files/folders group ownership.
change permission.
NOTE:
1. To use windows authorization, make sue the following setting are confirmed for the specific Samba user:
- set the Samba-username as Windows-username
- set the Samba-password as Windows-password
2. Remember to restart Samba after modification of smb.conf More ...