15 steps to configure samba on Ubuntu

August 27th, 2009 by Giridhar | Posted under Linux.

15 steps to configure samba on Ubuntu

1. sudo apt-get install samba
2. sudo /etc/init.d/samba stop
3. sudo mv /etc/samba/smb.conf /etc/samba/smb.conf.template
4. sudo touch /etc/samba/smb.conf
5. sudo touch /etc/samba/smb.conf
6. sudo vim /etc/samba/smb.conf
7. copy below mentioned contents to smb.conf
8. edit the following on smb.conf
a. netbios name = give desired name (No space !!)
b. wrokgroup = give same workgroup as you configured for windows PC
get it from control panel — > system –> computername
c. wins support = yes , if you have a static IP
d. [MyFiles]
Path = /home/samba/
force user = <give your windows username>
force group = <same as above>
9. Save and close
10. sudo mkdir /home/samba
11. sudo chmod 0777 /home/samba
12. sudo /etc/init.d/samba start
13. Create samba user
sudo useradd -s /bin/true mark  —-> if user doesn’t exist create a unix user first
sudo smbpasswd -L -a your_username   –> adduser
sudo smbpasswd -L -e your_username   –> edit user
(this will prompt for password)
14. access samba share from windows
\\<ip_address>\

This will prompt for username and password provie samba username and password created.

15. DONE !!!

—————- Minimum smb.conf needed ———————————————-
[global]
; General server settings
netbios name = YOUR_HOSTNAME
server string =
workgroup = YOUR_WORKGROUP
announce version = 5.0
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=8192 SO_SNDBUF=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: 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

[MyFiles]
path = /home/samba/
browseable = yes
read only = no
guest ok = no
create mask = 0644
directory mask = 0755
force user = YOUR_USERNAME
force group = YOUR_USERGROUP

Tags:

Comments

4 Responses to “15 steps to configure samba on Ubuntu”
  1. Gaurav says:

    i’m getting error as i dnt have authority to dwn load..
    so other way round i have the

    samba-3.5.2.tar.gz
    also samba-common_3.3.2-1ubuntu3.4_i386.deb
    samba-dbg_3.0.22-1ubuntu3.11_i386.deb
    samba_3.3.2.orig.tar.gz

    so plz tell how to install using these jars.. or wht else i need..

  2. Bill Maxwell says:

    I have been on several web pages explaining how to set up Samba so my windows network can see the Ubuntu. No luck with any of them not even yours. I am doing something wrong but just can’t see it. I have two Windows PC’s Vista and XP on a network and they work just fine. But neither can see the Ubuntu box. Ping works between them so I know the connection is ok.
    I just don’t know where to turn next.

Have any comments?