1821829 Members
3753 Online
109638 Solutions
New Discussion юеВ

Re: samba configuration

 
jpcast_real
Regular Advisor

samba configuration

Hello ,

I must create the user password for samba but I do not know its format or any utility to create it.

username map = /var/opt/samba/private/users.map

I have seen in internet this utiliy to do it "mksmbpasswd.sh" but I can not find it in the hp-ux samba.
Here rests one who was not what he wanted and didn't want what he was
21 REPLIES 21
Darren Prior
Honored Contributor

Re: samba configuration

Hi,

I think syncsmbpasswd might be what you're looking for. Otherwise you could use addtosmbpasswd for each entry in /etc/passwd that you want. If you want info on the format, there is a smbpasswd man page (also available through SWAT http://your_server_name:901 )

regards,

Darren.
Calm down. It's only ones and zeros...
Steven E. Protter
Exalted Contributor

Re: samba configuration

passwd
# set it.
smbpasswd -a

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
jpcast_real
Regular Advisor

Re: samba configuration

I think I have another problem:

smbuser:EWjUaE.9/OO52:107:20:,,,:/home/smbuser:/usr/bin/sh
madcc01:/etc/opt/samba> smbpasswd -a smbuser Siemens123
Unknown parameter encountered: "shared mem size"
Ignoring unknown parameter "shared mem size"
unable to open passdb database.
Added user smbuser.
madcc01:/etc/opt/samba>
Here rests one who was not what he wanted and didn't want what he was
jpcast_real
Regular Advisor

Re: samba configuration

I get it , but doing it which database am I changing ?? Where is it located
???
madcc01:/etc/opt/samba> smbpasswd -a smbuser Siemens123
Password changed for user smbuser.

Do I must have an Hp-UX user for each user I want to connect SAM ? Can I use username map for this purpose??
Here rests one who was not what he wanted and didn't want what he was
Darren Prior
Honored Contributor

Re: samba configuration

unless you've changed it within the smb.conf file, it will use /var/opt/samba/private/smbpasswd.

It depends on your configuration and usage, but generally you will need a matching HP-UX user for each user on the Windows side.

regards,

Darren.
Calm down. It's only ones and zeros...
jpcast_real
Regular Advisor

Re: samba configuration

Yes I have got it . I have crated added two hp-ux users to the samba database:

madcc01:/var/opt/samba/private> more smbpasswd
smbuser:107:DF7D4C80BE72A070AAD3B435B51404EE:B3A3496D3F61D8CDA3B865A2B4B29A37:[U
X ]:LCT-4087E0C0:
root:0:DF7D4C80BE72A070AAD3B435B51404EE:B3A3496D3F61D8CDA3B865A2B4B29A37:[UX
]:LCT-4087E161:

But when I try to connect from the windows :

\\139.16.240.112\tmp
smbuser
"password"

I get this output in the samba log files:

[2004/04/22 17:32:14, 1] smbd/password.c:(545)
Couldn't find user 'perecast' in passdb.
[2004/04/22 17:32:14, 1] smbd/password.c:(545)
Couldn't find user 'perecast' in passdb.
[2004/04/22 17:32:14, 1] smbd/reply.c:(1032)
Rejecting user 'perecast': authentication failed

"perecast" is my windows user!!!!!

Here rests one who was not what he wanted and didn't want what he was
Darren Prior
Honored Contributor

Re: samba configuration

Do you have the perecast user on your HP-UX server in /etc/passwd and in the smbpasswd files?

If you're trying to map by using the "smbuser" instead, then you will see the perecast user errors because the Windows box will send the current username and password initially.

regards,

Darren.
Calm down. It's only ones and zeros...
RAC_1
Honored Contributor

Re: samba configuration

Do you have perecast user in /etc/passwd??

map file is for mapping windows users to unix. (if user name is more than 8chars on windows side you can take care of it.)

In your case you need to have perecast user in smbpasswd file and in /etc/passwd file.

Also what security level you have set in smb.conf file? Is it to set to server?

Anil
There is no substitute to HARDWORK
jpcast_real
Regular Advisor

Re: samba configuration

I do not have smbuser neither in the /etc/passwd nor in the samba db . When I connect from the windows I give this credentials:

\\139.16.240.112\ccdev1
smbuser
"password"

This is my smb.conf if you want to have a look at it:

# from nb10300d.nbgm.siemens.de (157.163.24.118)
# Date: 2001/12/17 12:56:43

# Global parameters
[global]
netbios name = MADCC01
server string = Server %h Version %v
encrypt passwords = Yes
update encrypted = Yes
hosts equiv = /etc/hosts.equiv
null passwords = Yes
# username map = /etc/opt/samba/users.map
max open files = 20000
# shared mem size = 10485760
socket options = TCP_NODELAY IPTOS_LOWDELAY
kernel oplocks = No
guest account = nobody
create mask = 0777
directory mask = 0777
force create mode = 0777
force directory mode = 0777
security mask = 0777
directory security mask = 0777
force directory security mode = 0777
force security mode = 0777
guest ok = Yes
hosts allow = 157.163., 10.10., 141.73.168., 139.16.240., 158.92.51.
# in Abg AP: Guenter Rall, Thomas Springer
log level = 1
max log size = 1024
oplocks = No
username level = 8

[sccdev1]
path = /ccdev1
writeable = Yes

[sccdev2]
path = /ccdev2
writeable = Yes

[tmp]
path = /tmp
public = yes
only guest = yes
writeable = Yes
printeable = Yes
Here rests one who was not what he wanted and didn't want what he was
jpcast_real
Regular Advisor

Re: samba configuration

I have found an error message in the syslog.log file:

Apr 22 17:51:55 madcc01 smbd[4663]: Failed to set gid privileges to (-1,-2) no
w set to (0,0) uid=(0,0)
Apr 22 17:51:55 madcc01 smbd[4663]: [2004/04/22 17:51:55, 0] lib/util.c:(1094)
Apr 22 17:51:55 madcc01 smbd[4663]: PANIC: failed to set gid
Apr 22 17:51:55 madcc01 smbd[4663]:
Apr 22 17:51:55 madcc01 smbd[4663]:
Here rests one who was not what he wanted and didn't want what he was
RAC_1
Honored Contributor

Re: samba configuration


Add user smbuser to /etc/passwd (vipw/useradd) and add user to smbpasswd file(smbpasswd -a smbuser "password"

Restart samba
/sbin/init.d/samba stop
/sbin/init.d/samba start and check and post the results.

Anil
There is no substitute to HARDWORK
Darren Prior
Honored Contributor

Re: samba configuration

the error message related to gid(-1,-2) is because you are using "nobody" as the guest user. If you are using HP's CIFS server then it should have created a user called smbnull which you can use in the "guest=" part of the config.

back to your original problem - you need to have a user to authenticate against. smbuser needs to be in /etc/passwd and the smbpasswd or you must have smbuser mapped to a user that can be authenticated.

regards,

Darren.
Calm down. It's only ones and zeros...
RAC_1
Honored Contributor

Re: samba configuration

Read following document for good information on Samba.

http://www.oreilly.com/catalog/samba/chapter/book/ch06.pdf

Anil
There is no substitute to HARDWORK
jpcast_real
Regular Advisor

Re: samba configuration

I have the modifications form smbnull and now I have access to the /tmp directory but no the other 2 directories . This is my present configuration:

workgroup = MADCC01
netbios name = MADCC01
server string = Server %h Version %v
encrypt passwords = Yes
update encrypted = Yes
hosts equiv = /etc/hosts.equiv
null passwords = Yes
# username map = /etc/opt/samba/users.map
max open files = 20000
# shared mem size = 10485760
socket options = TCP_NODELAY IPTOS_LOWDELAY
kernel oplocks = No
guest account = smbnull
create mask = 0777
directory mask = 0777
force create mode = 0777
force directory mode = 0777
security mask = 0777
directory security mask = 0777
force directory security mode = 0777
force security mode = 0777
guest ok = Yes
hosts allow = 157.163., 10.10., 141.73.168., 139.16.240., 158.92.51.
# in Abg AP: Guenter Rall, Thomas Springer
log level = 1
max log size = 1024
oplocks = No
username level = 8

[sccdev1]
path = /ccdev1
writeable = Yes

[sccdev2]
path = /ccdev2
writeable = Yes

[tmp]
path = /tmp
public = yes
only guest = yes
writeable = Yes


these are the errors I get now:

Netbios nameserver version 2.2.8a based HP CIFS Server A.01.10 started.
Copyright Andrew Tridgell and the Samba Team 1994-2002
[2004/04/22 18:44:56, 1] lib/debug.c:(256)
INFO: Debug class all level = 1 (pid 5232 from pid 5232)
[2004/04/22 18:45:00, 0] nmbd/nmbd_responserecordsdb.c:(234)
find_response_record: response packet id 30651 received with no matching recor
d.
[2004/04/22 18:45:00, 0] nmbd/nmbd_responserecordsdb.c:(234)
find_response_record: response packet id 30652 received with no matching recor
d.
[2004/04/22 18:45:00, 0] nmbd/nmbd_responserecordsdb.c:(234)
find_response_record: response packet id 30653 received with no matching recor
d.

And in the syslog.log I get this error messages:

Apr 22 18:46:09 madcc01 smbd[5248]: madn041c (139.16.240.19) couldn't find ser
vice ccdev1
Apr 22 18:37:24 madcc01 smbd[5029]: [2004/04/22 18:37:24, 0] smbd/service.c:(251
)
Apr 22 18:46:13 madcc01 above message repeats 6 times
Apr 22 18:46:13 madcc01 smbd[5248]: [2004/04/22 18:46:13, 0] smbd/service.c:(251
)
Apr 22 18:37:24 madcc01 smbd[5029]: madn041c (139.16.240.19) couldn't find ser
vice ccdev2
Apr 22 18:46:13 madcc01 above message repeats 6 times
Apr 22 18:46:13 madcc01 smbd[5248]: madn041c (139.16.240.19) couldn't find ser
vice ccdev2
Apr 22 18:46:14 madcc01 smbd[5248]: [2004/04/22 18:46:14, 0] smbd/service.c:(251
)



Thanks everybody for the hel`p
Here rests one who was not what he wanted and didn't want what he was
RAC_1
Honored Contributor

Re: samba configuration

Do you have /ccdev2 directory on unix box?

Does it have appropriate permissions?

Anil
There is no substitute to HARDWORK
Darren Prior
Honored Contributor

Re: samba configuration

It looks like those 2 dirs don't exist on the HP-UX server. It's also worth running testparm to check for any errors in the smb.conf file.

The other point to note is that /tmp doesn't require any authentication - so your problem could still be related to that. It's well worth reading the HP docs for the server - http://docs.hp.com and the O'Reilly Using Samba book - available using SWAT (http://your_server:901 ) which has a section on authentication.

regards,

Darren.
Calm down. It's only ones and zeros...
jpcast_real
Regular Advisor

Re: samba configuration

Yes

madcc01:/var/adm/syslog> bdf
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol3 819200 92840 720712 11% /
/dev/vg00/lvol1 298928 87232 181800 32% /stand
/dev/vg00/lvol8 4710400 179960 4495168 4% /var
/dev/vg00/lvol6 3072000 909888 2145264 30% /usr
/dev/vg00/lvol5 2048000 51336 1981072 3% /tmp
/dev/vg00/lvol7 5406720 1703392 3674408 32% /opt
/dev/vg00/lvol4 1024000 3824 1012248 0% /home
/dev/vg01/ccdev2 20480000 573636 19595376 3% /ccdev2
/dev/vg01/ccdev1 20480000 673300 19497240 3% /ccdev1

I have seen in google that the problem can be caused by using samba nonencrypted passwords... Do you know ????
Here rests one who was not what he wanted and didn't want what he was
RAC_1
Honored Contributor

Re: samba configuration

What are the permissions on /ccdev1 and /ccdev2?

What is OS from Windows side? NT ???


Also goto directory where samba is installed. Is there a directory src?? Check for file service.c and look for error code 251.


Anil
There is no substitute to HARDWORK
jpcast_real
Regular Advisor

Re: samba configuration

Whit this configuration it work without asking password:

[ccdev1]
path = /ccdev1
public = yes
only guest = yes
writeable = Yes

[ccdev2]
path = /ccdev2
public = yes
only guest = yes
writeable = Yes

There was a problem , I had an "sccdev1" instead "ccdev1" . Anyway I can't make the hp-ux make the authentification..


Here rests one who was not what he wanted and didn't want what he was
RAC_1
Honored Contributor

Re: samba configuration

That is because of "only guest = yes"

In order to get authentication done from hp-ux server, put security = user under global area.

And under ccdev1 area put valid users = "users you want to give access to"

Restart and post the results.

Anil
There is no substitute to HARDWORK
Darren Prior
Honored Contributor

Re: samba configuration

You have guest ok=yes in the global area AND in each share - IT WILL NOT BOTHER ASKING FOR PASSWORDS IF GUEST OK IS SET!

Please read chapter 6 of the Using Samba - O'Reilly book (it's available online from SWAT) especially the section on user level security as it will explain how this type of authentication works. It discusses encrypted and non-encrypted passwords and how to add entries to smbpasswd.

regards,

Darren.
Calm down. It's only ones and zeros...