LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Samba and W2K/XP file sharing (https://www.linuxquestions.org/questions/linux-networking-3/samba-and-w2k-xp-file-sharing-189301/)

greno 06-03-2004 12:14 PM

Samba and W2K/XP file sharing
 
I have a new linux box that I want to share certain directories to my windows machines. I've setup Samba and configured smb.conf and smbusers to map windows usernames to linux usernames. On windows in Network Neighborhood I can see this new Linux box but when I click on its name I get prompted for a network username and password. So I try Administrator (which I mapped to root in the smbuser file). No luck with it or any other username. It just keeps prompting me to enter network username and password. Here's my smb.conf and smbusers files. Do you see anything in these files that would be a problem? thx

---------------------------------------------------------------------------------
smb.conf:
[global]
workgroup = Teliant
server string = Backup Server
hosts allow = 192.168.1. 192.168.2. 127.
printcap name = /etc/printcap
load printers = yes
printing = cups
log file = /var/log/samba/%m.log
max log size = 0
security = user
encrypt passwords = yes
smb passwd file = /etc/samba/smbpasswd
unix password sync = Yes
passwd program = /usr/bin/passwd %u
passwd chat = *New*password* %n\n *Retype*new*password* %n\n *passwd:*all*authentication*tokens*updated*successfully*
pam password change = yes
username map = /etc/samba/smbusers
obey pam restrictions = yes
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
dns proxy = no
[homes]
comment = Home Directories
browseable = no
writable = yes
valid users = %S
create mode = 0664
directory mode = 0775
[printers]
comment = All Printers
path = /var/spool/samba
browseable = no
guest ok = no
writable = no
printable = yes
[backups]
comment = Backups
path = /var/backup
valid users = %S
public = yes
writable = yes
printable = no

---------------------------------------------------------------------------------
smbusers:
# Unix_name = SMB_name1 SMB_name2 ...
root = administrator admin
amanda = Backup Backup.TELIANT
nobody = guest pcguest smbguest

I---------------------------------------------------------------------------------
also tried access from a Command Prompt window like this:

C:> net use z: \\tltbak01-lin01\backups
and got this error:
The password or username is invalid for \\tltbak01-lin01\backups

Please type the password for \\tltbak01-lin01\backups: *******
System error 1326 has occurred.

Login failure: unknown username or bad password

thx

greno 06-03-2004 12:57 PM

To followup, I created the smbpasswd file like this:
cat /etc/passwd | mksmbpasswd.sh > /etc/samba/smbpasswd

I keep reading the samba docs and it seems like I did everything but it still is not working.

thx

greno 06-04-2004 08:55 AM

Still not having any luck getting Samba working. I see this in /var/log/messages:

Jun 3 11:10:41 tltbak01-lin01 smb: smbd startup succeeded
Jun 3 11:10:41 tltbak01-lin01 smb: nmbd startup succeeded
Jun 3 11:53:35 tltbak01-lin01 su(pam_unix)[31172]: session opened for user administrator by root(uid=0)
Jun 3 11:53:45 tltbak01-lin01 su(pam_unix)[31172]: session closed for user administrator

and it seems to indicate that the user login authenticated but rather than let me browse the shared filesystem I just keep getting prompted to Enter Network Password. Anyone know what might be causing this problem ?????

greno 06-04-2004 09:16 AM

Here's some additional entries in the Samba logs:

log.nmbd:
Netbios nameserver version 2.2.7a started.
Copyright Andrew Tridgell and the Samba Team 1994-2002
[2004/06/04 09:43:52, 0] nmbd/nmbd_responserecordsdb.c:find_response_record(235)
find_response_record: response packet id 32360 received with no matching record.
[2004/06/04 09:43:52, 0] nmbd/nmbd_responserecordsdb.c:find_response_record(235)
find_response_record: response packet id 32361 received with no matching record.

What does this mean????

greno 06-04-2004 09:58 AM

I boosted logging level and I see this:

log.nmbd
[2004/06/04 10:41:20, 3] nmbd/nmbd_namelistdb.c:add_name_to_subnet(245)
add_name_to_subnet: Added netbios name TLTBAK01-LIN01<20> with first IP 192.168.2.10 ttl=0 nb_flags= 0 to subnet UNICAST_SUBNET
[2004/06/04 10:41:20, 10] nmbd/nmbd_subnetdb.c:namelist_entry_compare(74)
nmbd_subnetdb:namelist_entry_compare()
-1 == memcmp( "TLTBAK01-LIN01<03>", "TLTBAK01-LIN01<20>", 88 )
[2004/06/04 10:41:20, 10] nmbd/nmbd_subnetdb.c:namelist_entry_compare(74)
nmbd_subnetdb:namelist_entry_compare()
1 == memcmp( "TLTBAK01-LIN01<03>", "*<20>", 88 )
[2004/06/04 10:41:20, 9] nmbd/nmbd_namelistdb.c:find_name_on_subnet(132)
find_name_on_subnet: on subnet UNICAST_SUBNET - name TLTBAK01-LIN01<03> NOT FOUND

Is this significant??? It is repeating many times and then the log ends with repeating this a bunch of times:

[2004/06/04 10:42:04, 4] nmbd/nmbd_workgroupdb.c:find_workgroup_on_subnet(161)
find_workgroup_on_subnet: workgroup search for TELIANT on subnet 192.168.2.10: found.
[2004/06/04 10:42:04, 10] nmbd/nmbd_sendannounce.c:announce_myself_to_domain_master_browser(394)
announce_myself_to_domain_master_browser: no unicast subnet, ignoring.
[2004/06/04 10:42:04, 4] nmbd/nmbd_workgroupdb.c:dump_workgroups(289)
dump_workgroups()
dump workgroup on subnet 192.168.2.10: netmask= 255.255.255.0:
TELIANT(1) current master browser = UNKNOWN
TLTBAK01-LIN01 40019a03 (Backup Server)
---

greno 06-04-2004 10:38 AM

More logging:

renog01-w2p01.log:
[2004/06/04 10:41:48, 10] passdb/pdb_smbpasswd.c:pdb_getsampwnam(1388)
pdb_getsampwnam: found by name: root
[2004/06/04 10:41:48, 4] lib/substitute.c:automount_server(177)
Home server: tltbak01-lin01
[2004/06/04 10:41:48, 4] lib/substitute.c:automount_server(177)
Home server: tltbak01-lin01
[2004/06/04 10:41:48, 1] smbd/password.c:pass_check_smb(552)
Account for user 'root' was disabled.

^^^What does this mean????


[2004/06/04 10:41:48, 2] smbd/reply.c:reply_sesssetup_and_X(975)
NT Password did not match for user 'root'!

???? I tried both Administrator password and root's password - neither work.


[2004/06/04 10:41:48, 2] smbd/reply.c:reply_sesssetup_and_X(985)
Defaulting to Lanman password for root
[2004/06/04 10:41:48, 10] passdb/pdb_smbpasswd.c:pdb_getsampwnam(1346)
pdb_getsampwnam: search by name: root
[2004/06/04 10:41:48, 10] passdb/pdb_smbpasswd.c:startsmbfilepwent(167)
startsmbfilepwent_internal: opening file /etc/samba/smbpasswd
[2004/06/04 10:41:48, 6] passdb/pdb_smbpasswd.c:getsmbfilepwent(339)
getsmbfilepwent: skipping comment or blank line
[2004/06/04 10:41:48, 6] passdb/pdb_smbpasswd.c:getsmbfilepwent(339)
getsmbfilepwent: skipping comment or blank line
[2004/06/04 10:41:48, 6] passdb/pdb_smbpasswd.c:getsmbfilepwent(339)
getsmbfilepwent: skipping comment or blank line
[2004/06/04 10:41:48, 10] passdb/pdb_smbpasswd.c:getsmbfilepwent(392)
getsmbfilepwent: entry invalidated for user root
[2004/06/04 10:41:48, 7] passdb/pdb_smbpasswd.c:endsmbfilepwent(258)
endsmbfilepwent_internal: closed password file.


Does anyone have a clue as to why it is not recognizing the correct password?????

andrewdodsworth 06-04-2004 11:05 AM

set up a new linux user eg BACKUP - don't need it to be special. Then use 'smbpasswd BACKUP' in a shell to add a new Samba user with the same name as your linux user - but choose a different password for security reasons. This should work. You can even use 'smbpasswd root' to add root as a Samba user. The rights of the samba users are defined in the smb.conf file and are completely independent of the linux user.

greno 06-04-2004 11:17 AM

Ok, I did this for root. And now I can see the listing of the services but when I click on a service it prompts me again for Enter Network Password and gives this error when I try to login:

\\tltbak01-lin01\backups in not accessible

The credentials supplied conflict with an existing set of credentials.

greno 06-04-2004 12:17 PM

When I try to add the user BACKUP I get this problem:

root@tltbak01-lin01: samba # smbpasswd BACKUP
New SMB password:
Retype new SMB password:
Failed to find entry for user BACKUP.
Failed to modify password entry for user BACKUP

What entry? I'm adding a user so there shouldn't be an entry yet, right?

andrewdodsworth 06-04-2004 01:04 PM

yes you are adding a new Samba user - did you add BACKUP as a linux user before you did smbpasswd? there could also be a problem left over from your original creation of smbpasswd file itself - you can safely edit it and delete entries in it and then rerun the smbpasswd command. this could be the answer for your root problem.

greno 06-04-2004 01:11 PM

Ok, I'm not clear on the Samba user bit. How does this work? Are Samba users real users or are they some type of mapped user? If I log in as Administrator in the Enter Network Password box am I logging in as Administrator on that windows machine? Or am I logging in as a user only known to Samba? If it's only known to Samba then does Administrator have to be a real user under Linux? Or is it mapped to some other user under Linux like 'root'?

andrewdodsworth 06-05-2004 11:52 AM

By Samba users I mean users defined to the Samba server using smbpasswd. They have to be either identical name (but should be different password) to an existing linux user or mapped to an existing linux user. I had difficulty with mapping so I made new linux users for all my existing users and then ran smbpasswd for each. I don't use PAM or LDAP so all I had to do was change the linux settings to allow me longer usernames and passwords. I use my Samba server as a primary domain controller.
It looks from your smb.conf file that you are using PAM and also setting linux users up on the fly - I don't have any experience of that - it could be where your problems lie. I suggest you locate the docs (mine are in /usr/share/doc/packages/samba/htmldocs ) - the Samba-HOWTO-Collection.html is pretty comprehensive. I recommend starting with the simplest set up possible get it working (and save the smb.conf file!) and then start to add the complexities - one at a time.

CartersAdvocate 06-06-2004 05:33 PM

Quote:

Originally posted by greno
When I try to add the user BACKUP I get this problem:

root@tltbak01-lin01: samba # smbpasswd BACKUP
New SMB password:
Retype new SMB password:
Failed to find entry for user BACKUP.
Failed to modify password entry for user BACKUP

What entry? I'm adding a user so there shouldn't be an entry yet, right?

smbpasswd BACKUP attempts to change the smb-passwd entry for user BACKUP, the command you want to add the BACKUP user to the file is smbpasswd -a BACKUP

Then after that, do smbpasswd BACKUP in order to set the password that you want.


All times are GMT -5. The time now is 03:18 PM.