About Linux FAQ

Browse More FAQs:

Adding a user to a Samba (SMB) share

Posted by Vivek Gite [Last updated: June 23, 2006]

Q. I am using Fedora Linux and I would like to add a user called joe to Samba. How do I add a user SMB share?

A. The procedure is as follows:
First add Linux/UNIX user using useradd/adduser command.
Then use same user name to add to Samba share using smbpasswd command.

Step # 1: Add a user joe to UNIX/Linux system
adduser command adds user to the system according to command line options and configuration information in /etc/adduser.conf. They are friendlier front ends to the low level tools like useradd.

Type any one of the following command:

# useradd joe
# passwd joe

OR

# adduser joe

Step # 2: Add a user to samba
Now user joe has account on Linux/UNIX box. Use smbpasswd command to specifies that the username following should be added to the local smbpasswd file:

# smbpasswd -a joe

Step # 3: Add a user to a Samab share
By default user gets access to /home/joe from windows system. Let us say you want to give joe access to /data/accounts (make sure directory /data/accounts exists) directory. Open /etc/samba/smb.conf file and add/modify share called [accounts]:

[accounts]
comment = Accounts data directory
path = /data/accounts
valid users = vivek raj joe
public = no
writable = yes

Save the file

Step #4: Restart the samba

# service smb restart

OR

# /etc/init.d/smb reload

See also:

Subscribe to our free e-mail newsletter or RSS feed to get all updates. You can Email this page to a friend.

Related Other Helpful FAQs:

Leave a Reply

We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Copyright © 2006-2008 nixCraft. All rights reserved - TOS/Disclaimer - Privacy policy - Sitemap - Powered by Open source software.