Creating Samba User

October 22nd, 2006 liewsheng Posted in Admin, smbpasswd, useradd | Hits: 66655 | 7 Comments »

After you have install samba sever, yous still can’t login samba server. You will need create a samba user :

smbpasswd -a username

‘-a’ switch tell smbpasswd we want to add a new user, is the user you want to add. Please take note, username must exist in /etc/passwd file else you will need the use ‘useradd’ to create a user in Linux :

useradd -d /home/username -s /bin/false -n username

This will create a new user with same group name with (told by ‘-n’), but the user can’t login and run any shell command (because you have specfic the login shell is /bin/false by the ‘-s’ switch, if you want allow user to able to login to a shell, replace /bin/false with /bin/sh).

Ok now you have create a new samba user, how about you want delete or disable them? ‘-d’ switch will disable the user to login to samba server:

smbpasswd -d username

If you want to delete a user permanently:

smbpasswd -x username

Hope you guys, happy communicate with Windows ya ;-p

7 Responses to “Creating Samba User”

  1. [...] How? My friend’s (toydi) side need to create a reverse tunnel, 1. He create an user account for me as mysurface, uses useradd 2. Set a default password for mysurface user account, uses passwd 3. Setup ssh reverse tunnel [...]

  2. [...] Samba Create Samba user: http://linux.byexamples.com/archives/123/creating-samba-user/ Open terminal and type… smbpasswd -a [...]

  3. Muchisimas gracias por el dato, me sirvio bastante…

  4. There is some solid information on this page. I am in love with your blog so far. I’ve added the feed to my boomarks and will give you a mentioning over at my blog. I did have a problem with how quick this blog entry loaded. Might be a problem to optimize.

  5. Hello . I love browsing your site. If you want to learn about Dance Jazzy House R&B check out my site!

  6. thanks alot dear it worked 4 me

  7. Thanks for this simple Samba guide.

Leave a Reply