# Samba Users - A Slew of Problems



## mallen324 (Aug 3, 2011)

Anytime I have a request to have a user added to access our server, I get a headache. It shouldn't be that tough, but I always have problems. I tried to add a user, "ysingh", that account didn't work. Okay, I'll delete the account :


```
$ sudo rmuser ysingh 
Matching password entry:

ysingh:*:1009:513::0:0:System User:/home/ysingh:/bin/sh

Is this the entry you wish to remove? y
Remove user's home directory (/home/ysingh)? y
Removing user (ysingh): home passwdpw: user 'ysingh' does not exist: No such file or directory
.
```


```
$ sudo pdbedit -x ysingh
smbldap_search_domain_info: Searching for:[(&(objectClass=sambaDomain)(sambaDomainName=SPRINGFIELD))]
smbldap_open_connection: connection opened
ldap_connect_system: successful connection to the LDAP server
user ysingh does not exist in the passdb
```

Should be good right? NO:


```
$ id ysingh
uid=1009(ysingh) gid=513(Domain Users) groups=513(Domain Users)
```

Not sure how to go about deleting this guy now.

In my next post I'll show my process to try and add an account.


----------



## SirDice (Aug 3, 2011)

What version of Samba? What version of FreeBSD?

Keep in mind that the Unix account (the one in /etc/passwd) and the Samba account (created with pdbedit) are separate. Deleting the samba account does NOT delete the unix account.


----------



## mallen324 (Aug 3, 2011)

Sorry, my post was pretty useless without posting those pieces of info.

Samba 3.4
FreeBSD 8.1

I know they are separate, I just wanted to show I tried deleting ysingh both ways.


----------



## mallen324 (Aug 3, 2011)

Ok, So I was able to add no problem this time. Im goin to sound crazy, but I followed the same process -  "sudo adduser". This time it worked, however it had to be ysingh01 since I now got some ghost accounts I don't know how to delete (singh, ysingh, ysingh1). Any ideas?


----------



## Sylhouette (Aug 22, 2011)

what does the following command return:


```
pdbedit -L
```


what does the following command return:


```
cat /etc/passwd | cut -d: -f1 | grep -v \#
```

In one of these commands you will see your ghost accounts.

if with pdbedit you find them, then you need to remove them with pdbedit.


regards,
Johan Hendriks


----------



## kisscool-fr (Aug 22, 2011)

Do you use a samba+ldap config ? 

What is your smb.conf content ?


----------



## mallen324 (Aug 26, 2011)

Sylhouette - Neither of those commands showed my ghost accounts. Thanks for the suggestion though. 

I have found this in the smb.conf file:


```
add user script = /usr/local/sbin/smbldap-useradd -m %u

  add group script = /usr/local/sbin/smbldap-groupadd -p %g

  add machine script = /usr/local/sbin/smbldap-useradd -w %u

  delete user script = /usr/local/sbin/smbldap-userdel %u

  delete user from group script = /usr/local/sbin/smbldap-groupmod -x %u %g

  delete group script = /usr/local/sbin/smbldap-groupdel %g
```

Ok, so running smbldap-userdel 'username' did delete the ghost account! Sweet!

Now I got a problem with groups and group permissions, but I'll make a new thread. 

Thank you all for helping me through this!


----------

