Samba Server Install on Debian 7 (Wheezy)

Version 1.1
Author: Srijan Kishore

This guide explains how to install and configure Samba server in Debian 7 with anonymous and secured samba servers. 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.

1 Preliminary Note

I have fresh installed Debian 7 server, on which I am going to install the samba server. Off-course you need to have one windows machine to check the  samba server that must be reachable with the Debian server. My Debian server have hostname & IP as

You can have your Debian server installed from the starting seven chapters of the tutorial.


  • The Windows machine must be on same workgroup. To check the value in windows machine run the command at cmd prompt

net config workstation

It will be like this


Your windows machine must be at same Workstation domain as in Debian server, i.e. WORKGROUP in my case.
  • To make the windows machine reachable in windows proceed like this. In the run terminal & add  the entry of your server IP address

notepad C:\Windows\System32\drivers\etc\hosts

In my case it was like this, just save the values.

[...] debian


2 Anonymous samba sharing

First I will explain the methodology to install the samba with the anonymous sharing. To install samba run,

apt-get install samba samba-common libcups2

It will install samba with Version 3.6.6.

Now to configure samba edit the file /etc/samba/smb.cnf before making changes I will make the backup of original file as  /etc/samba/smb.cnf.bak

mv /etc/samba/smb.conf /etc/samba/smb.conf.bak

Further give the entries like this

vi /etc/samba/smb.cnf

workgroup = WORKGROUP
server string = Samba Server %v
netbios name = debian
security = user
map to guest = bad user
dns proxy = no
#============================ Share Definitions ============================== 
path = /samba/anonymous
browsable =yes
writable = yes
guest ok = yes
read only = no

mkdir -p /samba/anonymous

service samba restart

Now you can access the debian sharing in windows as follows:


From windows machine just browse the folder& try to create a text file, but you will get an error of permission denied.


Check the permission for the shared folder.

[email protected]:~# ls -l /samba/
total 4
drwxr-xr-x 2 root root 4096 May 27 18:17 anonymous
[email protected]:~#

To allow anonymous user give the permissions as follows;

[email protected]:~# cd /samba
[email protected]:/samba# chmod -R 0755 anonymous/
[email protected]:# chown -R nobody:nogroup anonymous/
[email protected]:/samba# ls -l
total 4
drwx-xr-x 2 nobody nogroup root 4096 May 27 18:17 anonymous
[email protected]:/samba#

Now anonymous user can browse & create the folder contents.

You can cross check the content at server also.

[email protected]:/samba# ls -l anonymous/
total 0
-rwxr--r-- 1 nobody nogroup 0 May 29 18:47 anonymous_test.txt
[email protected]:/samba# 


Share this page:

5 Comment(s)

Add comment


From: Jean-Marc Liotier

'chmod -R 0777' ? Please - you certainly know better. There is never a good reason for 777 permissions !

From: admin

I fully agree with you. I asked the author to update the tutorial.


In my case the line:

vi /etc/samba/smb.cnf

should read:

vi /etc/samba/smb.conf

Otherwise  I get a error that it cant open config file when I start samba.

From: foobar

Just to shorten up a bit,  you can choose between

writable = yes


read only = no

both seem redundant for me


From: Kevin Orellana

I put it to the test this day and it worked, good post.