Linux: Add Samba User


To add a samba user, which can be assigned to a Samba share or can log into a domain configured with Samba, we do the following:

1) We add the Linux user:

# useradd -g user groupname
# passwd user

2) We add the Samba user:

# smbpasswd -a user

3) By default, the user will have access to its “home” from a Windows system. But if we want to give it permissions on a particular directory, we have to edit /etc/samba/smb.conf and add:

[directoryname]
comment = directory shared with samba
path = /data/shareddirectory
valid users = user userother userother
public = no
writable = yes

5) Restart or Reload Samba:

# service smb restart

or

# service smb reload

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s