Install and configure Samba
Posted: July 11, 2009 at 8:04 pm | Tags: Linux , network , samba , smb , tcp / ip , winsSamba is an open source, which allows Unix-based operating systems to "see" the network with Windows PCs. Samba is actually implementing several protocols in one software able to communicate simultaneously with these protocols: SMB, TCP / IP, NetBIOS (protocol implemented in Windows Network Neighborhood), WINS and Active Directory (this should be set for Kerberos ).
First, to successfully set Samba to be the machine that runs Linux to have a static IP. Otherwise, it will not use WINS ...
Install Samba:
# Sudo apt-get install samba
After installation, you must make sure that Samba is not running:
# Sudo / etc / init.d / samba stop
smb.conf is the configuration file of Samba. We rename this file in the following:
# Sudo mv / etc / samba / smb.conf / etc / samba / smb.conf.template
The following command will create a new file:
# Sudo touch / etc / samba / smb.conf
Then we edit the new file in your favorite editor:
# Sudo gedit / etc / samba / smb.conf
So that would be put in the new file:
[Global]
; General server settings
netbios name = YOUR_HOSTNAME
server string =
workgroup = YOUR_WORKGROUP
announce version = 5.0
socket options = TCP_NODELAY SO_KEEPALIVE SO_RCVBUF = 8192 SO_SNDBUF IPTOS_LOWDELAY = 8192
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
; NOTE: If You Need access to the user home directories uncomment the
; Lines and Below Adjust the settings to your hearts content.
; [Homes]
; Valid users =% S
; Create mode = 0600
; Directory mode = 0755
; Browseable = no
; Read only = no
; Veto files = / *. {*} /. * / Mail / bin /
; NOTE: Only Needed if you run samba as a primary domain controller.
; Not this config I Needed That Does not cover matter.
; [NETLOGON]
; Path = / var / lib / samba / NETLOGON
; Admin users = Administrator
; Valid users =% U
; Read only = no
; NOTE: Again - Needed only if you're running a primary domain controller.
; [Profiles]
; Path = / var / lib / samba / profiles
; Valid users =% U
; Create mode = 0600
; Directory mode = 0700
; Writeable = yes
; Browseable = no
; NOTE: Inside this place you may build a printer driver repository for
; Windows - I'll cover this topic in Another HOWTO.
[Print $]
path = / var / lib / samba / printers
browseable = yes
guest ok = yes
read only = yes
write list = root
create mask = 0664
directory mask = 0775
[Printers]
path = / tmp
printable = yes
guest ok = yes
browseable = no
; Uncomment if You Need to share your CD-/DVD-ROM Drive
; [DVD-ROM Drive]
; Path = / media / cdrom
; Browseable = yes
; Read only = yes
; Guest ok = yes
[MyFiles]
path = / media / samba /
browseable = yes
read only = no
guest ok = no
create mask = 0644
directory mask = 0755
force user = YOUR_USERNAME
force group = YOUR_USERGROUP
Sure to be made some changes:
netbios name = HOSTNAME YOUR_HOSTNAME be replaced with your
workgroup = YOUR_WORKGROUP be replaced with your workgroup (who is set on Windows). Generally, on Windows, workgrupului name is Workgroup or MSHOME.
wins support = yes
If you have static IP or use a different IP Dimana reasons, the above option should be set to "no" instead of "yes".
[MyFiles] is the share name ului.Poate be renamed anyway, but should be avoided spaces (as well as for the other names).
path = / media / samba / Suppose this path is a mounted hard drive or another partition, and is where files are saved share look.
If not available another hard drive or another partition, you can create a Home folder for example, where you can share your files look:
# Sudo mkdir / home / samba
In this case, the path will be:
# Path = / home / samba /
Because / home / samba will be a folder where you have to write more world, we will grant the correct permissions:
# Sudo chmod 0777 / home / samba
About this would be setting must pormin service now:
# Sudo / etc / init.d / samba start
We must add users.
First, to successfully set Samba to be the machine that runs Linux to have a static IP. Otherwise, you can not use WINS ...
Install Samba:
# Sudo apt-get install samba
After installation, you must make sure that Samba is not running:
# Sudo / etc / init.d / samba stop
smb.conf is the configuration file of Samba. We rename this file in the following:
# Sudo mv / etc / samba / smb.conf / etc / samba / smb.conf.template
The following command will create a new file:
# Sudo touch / etc / samba / smb.conf
Then we edit the new file in your favorite editor:
# Sudo gedit / etc / samba / smb.conf
So that would be put in the new file:
[Global]
; General server settings
netbios name = YOUR_HOSTNAME
server string =
workgroup = YOUR_WORKGROUP
announce version = 5.0
socket options = TCP_NODELAY SO_KEEPALIVE SO_RCVBUF = 8192 SO_SNDBUF IPTOS_LOWDELAY = 8192
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
; NOTE: If You Need access to the user home directories uncomment the
; Lines and Below Adjust the settings to your hearts content.
; [Homes]
; Valid users =% S
; Create mode = 0600
; Directory mode = 0755
; Browseable = no
; Read only = no
; Veto files = / *. {*} /. * / Mail / bin /
; NOTE: Only Needed if you run samba as a primary domain controller.
; Not this config I Needed That Does not cover matter.
; [NETLOGON]
; Path = / var / lib / samba / NETLOGON
; Admin users = Administrator
; Valid users =% U
; Read only = no
; NOTE: Again - Needed only if you're running a primary domain controller.
; [Profiles]
; Path = / var / lib / samba / profiles
; Valid users =% U
; Create mode = 0600
; Directory mode = 0700
; Writeable = yes
; Browseable = no
; NOTE: Inside this place you may build a printer driver repository for
; Windows - I'll cover this topic in Another HOWTO.
[Print $]
path = / var / lib / samba / printers
browseable = yes
guest ok = yes
read only = yes
write list = root
create mask = 0664
directory mask = 0775
[Printers]
path = / tmp
printable = yes
guest ok = yes
browseable = no
; Uncomment if You Need to share your CD-/DVD-ROM Drive
; [DVD-ROM Drive]
; Path = / media / cdrom
; Browseable = yes
; Read only = yes
; Guest ok = yes
[MyFiles]
path = / media / samba /
browseable = yes
read only = no
guest ok = no
create mask = 0644
directory mask = 0755
force user = YOUR_USERNAME
force group = YOUR_USERGROUP
Sure to be made a few changes:
netbios name = HOSTNAME YOUR_HOSTNAME be replaced with your
workgroup = YOUR_WORKGROUP be replaced with your workgroup (who is set on Windows). Generally, on a Windows machine, workgrupului name is Workgroup or MSHOME.
wins support = yes
If you have static IP or use a different IP Dimana reasons, the above option should be set to "no" instead of "yes".
[MyFiles] is the share name ului.Poate be renamed anyway, but should be avoided spaces (as well as for the other names).
path = / media / samba / Suppose this path is a mounted hard drive or another partition, and is where files are saved share look.
If not available another hard drive or another partition, you can create a Home folder for example, where you can share your files look:
# Sudo mkdir / home / samba
In this case, the path will be:
# Path = / home / samba /
Because / home / samba will be a folder where you have to write more world, we will grant the correct permissions:
# Sudo chmod 0777 / home / samba
About this would be setting must pormin service now:
# Sudo / etc / init.d / samba start
Longer need to add users, but this time viitoare.Samba is an open source, which allows Unix-based operating systems to "see" the network with Windows PCs. Samba is actually implementing several protocols in one software able to communicate simultaneously with these protocols: SMB, TCP / IP, NetBIOS (protocol implemented in Windows Network Neighborhood), WINS and Active Directory (this should be set for Kerberos).
First, to successfully set Samba to be the machine that runs Linux to have a static IP. Otherwise, you can not use WINS ...
Install Samba:
# Sudo apt-get install samba
After installation, you must make sure that Samba is not running:
# Sudo / etc / init.d / samba stop
smb.conf is the configuration file of Samba. We rename this file in the following:
# Sudo mv / etc / samba / smb.conf / etc / samba / smb.conf.template
The following command will create a new file:
# Sudo touch / etc / samba / smb.conf
Then we edit the new file in your favorite editor:
# Sudo gedit / etc / samba / smb.conf
So that would be put in the new file:
[Global]
; General server settings
netbios name = YOUR_HOSTNAME
server string =
workgroup = YOUR_WORKGROUP
announce version = 5.0
socket options = TCP_NODELAY SO_KEEPALIVE SO_RCVBUF = 8192 SO_SNDBUF IPTOS_LOWDELAY = 8192
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
; NOTE: If You Need access to the user home directories uncomment the
; Lines and Below Adjust the settings to your hearts content.
; [Homes]
; Valid users =% S
; Create mode = 0600
; Directory mode = 0755
; Browseable = no
; Read only = no
; Veto files = / *. {*} /. * / Mail / bin /
; NOTE: Only Needed if you run samba as a primary domain controller.
; Not this config I Needed That Does not cover matter.
; [NETLOGON]
; Path = / var / lib / samba / NETLOGON
; Admin users = Administrator
; Valid users =% U
; Read only = no
; NOTE: Again - Needed only if you're running a primary domain controller.
; [Profiles]
; Path = / var / lib / samba / profiles
; Valid users =% U
; Create mode = 0600
; Directory mode = 0700
; Writeable = yes
; Browseable = no
; NOTE: Inside this place you may build a printer driver repository for
; Windows - I'll cover this topic in Another HOWTO.
[Print $]
path = / var / lib / samba / printers
browseable = yes
guest ok = yes
read only = yes
write list = root
create mask = 0664
directory mask = 0775
[Printers]
path = / tmp
printable = yes
guest ok = yes
browseable = no
; Uncomment if You Need to share your CD-/DVD-ROM Drive
; [DVD-ROM Drive]
; Path = / media / cdrom
; Browseable = yes
; Read only = yes
; Guest ok = yes
[MyFiles]
path = / media / samba /
browseable = yes
read only = no
guest ok = no
create mask = 0644
directory mask = 0755
force user = YOUR_USERNAME
force group = YOUR_USERGROUP
Sure to be made a few changes:
netbios name = HOSTNAME YOUR_HOSTNAME be replaced with your
workgroup = YOUR_WORKGROUP be replaced with your workgroup (who is set on Windows). Generally, on a Windows machine, workgrupului name is Workgroup or MSHOME.
wins support = yes
If you have static IP or use a different IP Dimana reasons, the above option should be set to "no" instead of "yes".
[MyFiles] is the share name ului.Poate be renamed anyway, but should be avoided spaces (as well as for the other names).
path = / media / samba / Suppose this path is a mounted hard drive or another partition, and is where files are saved share look.
If not available another hard drive or another partition, you can create a Home folder for example, where you can share your files look:
# Sudo mkdir / home / samba
In this case, the path will be:
# Path = / home / samba /
Because / home / samba will be a folder where you have to write more world, we will grant the correct permissions:
# Sudo chmod 0777 / home / samba
About this would be setting must pormin service now:
# Sudo / etc / init.d / samba start
Longer need to add users, but that next time.
























