Subscribe to How-To Geek

Recommended: Click Here to Run a Free Scan for Common PC Errors   [Sponsored Link]

Create a Samba User on Ubuntu

If you are using Samba Server on your network, you will want to create users that have access to use it. There's a very simple command structure on how to do so.

I'm assuming that you've already installed Samba Server at this point.

There are two steps to creating a user. First we'll run the smbpasswd utility to create a samba password for the user.

sudo smbpasswd -a <username>

Next, we'll add that username to the smbusers file.

sudo gedit /etc/samba/smbusers

Add in the following line, substituting the username with the one you want to give access to. The format is <ubuntuusername> = "<samba username>". You can use a different samba user name to map to an ubuntu account, but that's not really necessary right now.

<username> = "<username>"

Now you can create samba shares and give access to the users that you listed here.

The Geek is the founder of How-To Geek and a geek enthusiast. When he's not coming up with great how-to articles, he's probably writing at his personal blog. This article was written on 01/7/07 and tagged with: Ubuntu

Comments (2)

  1. Atomicron

    Thanks for this tip. I was trying to get Mac OS 10.4.something to access a samba share on my Ubuntu file server and this did the trick. One small detail to note is that /etc/samba/smbusers file did not exist on my system (feisty fawn). However, just creating the file is the designated directory was all I had to do.

  2. Arvind

    I have no success with this method. I have installed Samba on a Debian Linux box and trying to connect from a Windows XP professional box. On the Windows box I have logged on using my corporate domain account. I created an /etc/samba/smbusers file and tried with both username= "domain\windows username" and username = "windows username". It always prompts me for an username/password box. Am I missing something here ? Thanks.


Leave a Comment




Leave your friendly comment here. If you have a computer help question, leave it on the forums instead.

Note: Your comment may not show up immediately on the site.

Copyright © 2006-2008 HowToGeek.com. All Rights Reserved.