Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using a linux distribution based on Ubuntu 10.04 (Backtrack 5 R1). I successfully managed to create a samba share that is read/write accessible to everyone in my network. I want to protect this share with a username / password combo. Any host in my network that can provide this combo can access the share and edit its contents.

Is this technically feasible? If yes, how can I do so?

share|improve this question
I googled and tried to edit authentication mode, add smb passwords with "smbpasswd" , etc.. But with no results. – lisa1987 Dec 14 '11 at 19:47
Very feasible. I think we need more information on what you tried. – user606723 Dec 14 '11 at 21:24
up vote 2 down vote accepted

There are many things you can do to secure samba from passwords to kerberos.

First, to access the share, you will be using a user name and password configured on the samba server.

I assume you already have a (login) user.

You then assign a samba password to the user

sudo smbpasswd -a username
sudo smbpasswd -e username

You then define your shares in /etc/samba/smb.conf

sudo -e /etc/samba/smb.conf

gksu gedit /etc/samba/smb.conf

In the section where you define your shared directory

comment = private share
path = /path/to/share/point
browseable = no
read only = no
guest ok = no

After making those edits, restart the samba server.

sudo service samba restart

There are a number of security features for samba, see also

Ubuntu Server Guide Securing Samba

Ubuntu Community Wiki Samba Server Guide

share|improve this answer
I only have "root" user. Do I need to create a new user? – lisa1987 Dec 14 '11 at 21:38
personally, I would create a non-root user, but you do not need to. – bodhi.zazen Dec 14 '11 at 21:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.