Operating System - HP-UX
1850667 Members
3127 Online
104055 Solutions
New Discussion

"smbpasswd -a" complains about negative ID in smbpasswd file.

 
Thomas Doherty_1
Occasional Advisor

"smbpasswd -a" complains about negative ID in smbpasswd file.

Whenever we add a new user with smbpasswd -a we get an error message about a negative number in the smbpasswd file. The nobody ID is -2. Does the nobody ID really need to be in the smbpasswd file? Can I comment out the line or change the ID in SAM to a positive number? BTW, the user still gets added to smbpasswd file so the message isn't affecting access to Samba.

Thanks
9 REPLIES 9
Steven E. Protter
Exalted Contributor

Re: "smbpasswd -a" complains about negative ID in smbpasswd file.

The user needds to be set up in /etc/passwd first.

If its not there,

useradd username


as root

Then try the smbpasswd -a command.

This assumes no NIS or LDAP connection to a Microsoft box. Thats a differenent scenario.

If LDAP is in the authentication, you need account for the unix box on the LDAP server and you don't need to run smbpasswd to add users.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Thomas Doherty_1
Occasional Advisor

Re: "smbpasswd -a" complains about negative ID in smbpasswd file.

Thanks SEP but we have no problem adding the user. We just get the annoying warning message about a UID in smbpasswd with a negative number.
Steven E. Protter
Exalted Contributor

Re: "smbpasswd -a" complains about negative ID in smbpasswd file.

Here is what I should have posted.

pwck

Check the integrity of /etc/passwd, because problems there can generate the error.

grpck

Same basic idea.

There probably is an integrity check for the smbpasswd database as well.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Thomas Doherty_1
Occasional Advisor

Re: "smbpasswd -a" complains about negative ID in smbpasswd file.

SEP, the password and group files check out fine. The nobody UID in /etc/passwd is a -2 which is the same UID for nobody in /opt/samba/private/smbpasswd. Apparently the smbpasswd command does not like the -2 in the smbpasswd file. My question is, should I comment out the nobody user from the smbpasswd file or change the UID from -2 to a positive integer for both /etc/passwd and /opt/samba/private/smbpasswd?

Thanks
Zeev Schultz
Honored Contributor

Re: "smbpasswd -a" complains about negative ID in smbpasswd file.

The question is why should you have nobody in
the smbdpasswd (encrypted passwords) file?For
guest account?Define something else.

As a matter of fact (and matter of samba source - see here http://us2.samba.org/samba/ftp/cvs_current/source/passdb/pdb_smbpasswd.c :
if(*p == '-') {
DEBUG(0, ("getsmbfilepwent: uids in the smbpasswd file must not be negative.\n"));
continue;

) Samba wouldn't adjust itself to that one,so
one should get adjusted to Samba :)

Zeev

So computers don't think yet. At least not chess computers. - Seymour Cray
U.SivaKumar_2
Honored Contributor

Re: "smbpasswd -a" complains about negative ID in smbpasswd file.

Hi,

There is no need for user nobody in samba implementation. Samba has it's own internal guest account with least priveleges.

The user nobody is of no use relates to samba access. Include only valid accounts in smdpasswd file.

regards,
U.SivaKumar
Innovations are made when conventions are broken
Steven E. Protter
Exalted Contributor

Re: "smbpasswd -a" complains about negative ID in smbpasswd file.

I'd take out nobody completely.

You don't need it for user validation.

Surely if you are using smbpasswd to enable access you aren't authorizing worldwide access.

Add guest account individually, so you can keep track of them.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Thomas Doherty_1
Occasional Advisor

Re: "smbpasswd -a" complains about negative ID in smbpasswd file.

Thanks guys.
Fragon
Trusted Contributor

Re: "smbpasswd -a" complains about negative ID in smbpasswd file.

Hi,
First of all, the guest account is not necessary for the Samba passwd file.
Just a test for root:
#smbpasswd -a root
The password may different to the password of /etc/passwd!
Do you still get -2 ID?

-ux