Adding a user to a Samba (SMB) share
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:
- Howto: Adding share in samba server under Linux or UNIX
- Configure a system to automount a Samba share with /etc/fstab
- Access Windows Shares from Linux
- Samba mount and access large 2GB+ files from share or NAS device
- How to use Linux as file server
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!


Recent Comments
Today ~ 2 Comments
Today ~ 57 Comments
Yesterday ~ 9 Comments
Yesterday ~ 7 Comments
Yesterday ~ 1 Comment