Samba Server installation on Ubuntu 14.10

Samba Server installation on Ubuntu 14.10

Samba Server installation on Ubuntu 14.10

This guide explains how to install and configure a samba server on Ubuntu 14.10 with anonymous & secured samba shares. 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 Ubuntu 14.10 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 Ubuntu server. My Ubuntu server have hostname & IP as __ez_fad_position != ‘undefined’){__ez_fad_position(‘div-gpt-ad-howtoforge_com-medrectangle-3-0’)};

You can have your Ubuntu server installed from 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 Ubuntu 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.

[...] ubuntu

if(typeof __ez_fad_position != ‘undefined’){__ez_fad_position(‘div-gpt-ad-howtoforge_com-medrectangle-4-0’)};

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 python-glade2 system-config-samba

It will install samba with version 4.1.11-Ubuntu.

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

cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
cat /dev/null  > /etc/samba/smb.conf

Further give the entries like this

vi /etc/samba/smb.conf

workgroup = WORKGROUP
server string = Samba Server %v
netbios name = ubuntu
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 smbd restart

Now you can access the Ubuntu 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.

ls -l /samba/

[email protected]:~# ls -l /samba/
total 4
drwxr-xr-x 2 root root 4096 Nov  7 08:33 anonymous
[email protected]:~#

To allow anonymous user give the permissions as follows;

cd /samba
chmod -R 0755 anonymous/
chown -R nobody:nogroup anonymous/
ls -l

[email protected]:/samba# ls -l
total 4
drwxr-xr-x 2 nobody nogroup 4096 Nov  7 08:33 anonymous
[email protected]:/samba#

Now anonymous user can browse & create the folder contents.

You can cross check the content at server also.

ls -l anonymous/

[email protected]:/samba# ls -l anonymous/
total 0
-rwxr–r– 1 nobody nogroup 0 Nov  7 10:19 anonymous_share.txt
[email protected]:/samba#

3. Secured samba server

For this I will create a group smbgrp & user srijan to access the samba server with proper authentication

addgroup smbgrp

useradd srijan -G smbgrp

smbpasswd -a srijan

[email protected]:~# smbpasswd -a srijan
New SMB password:<–yoursambapassword
Retype new SMB password:<–yoursambapassword
Added user srijan.
[email protected]:~#

Now create the folder viz secured in the /samba folder & give permissions like this

mkdir -p /samba/secured
cd /samba
chmod -R 0770 secured/

Again edit the configuration file as and add the entries at the end of the file :

nano /etc/samba/smb.conf

[secured] path = /samba/secured valid users = @smbgrp guest ok = no writable = yes browsable = yes

service smbd restart 

Further to cross-check the settings check as follows:


[email protected]:~# testparm
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section “[Anonymous]”
Processing section “[secured]”
Loaded services file OK.
Press enter to see a dump of your service definitions<–ENTER

    netbios name = UBUNTU
    server string = Samba Server %v
    map to guest = Bad User
    dns proxy = No
    idmap config * : backend = tdb

    path = /samba/anonymous
    read only = No
    guest ok = Yes

    path = /samba/secured
    valid users = @smbgrp
    read only = No
[email protected]:~#

Now at windows machine check the folder now with the proper credentials, as created above. In my case values were user=srijan and password=yoursambapassword

You will again face the issue of permissions to give write permission to the user srijan do:

cd /samba
chown -R srijan:smbgrp secured/

Now samba user srijan  have permissions to write in the folder.

We can check the file at Ubuntu server as :

ls -l /samba/secured/

[email protected] # ls -l /samba/secured
total 0
-rwxr–r– 1 srijan srijan 0 Nov  7 11:32 secured_test.txt
[email protected] #

Cheers now we have a successfully configured samba server over Ubuntu 14.10 🙂

  • Ubuntu :
  • Samba :
About the Author

Leave a Reply