Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have a home file server on which I have recently reinstalled the OS. I replaced Ubuntu Server 10.04.2 32-bit with 10.04.3 64-bit due to hardware upgrades. I've copied my previous Samba configuration over, recreated the share user, and made sure the permissions for the shared directories, on another disk, were still intact. I have an XP and a Win7 machine. Both can see the file server, but neither can access the shares. If I go to \\Server on a Windows machine, it prompts for a user/pass and appears to accept the connection. If I go to \\Server\Share next, it asks for a user/pass again, and will not authenticate.

No network settings have changed on the Windows machines. Is there some other configuration I might be missing for the server? What else could be wrong?

Troubleshooting: I found the logs, as suggested. smbd and nmbd are both running. In the logs for the windows machines, I get a lot of lines like this when trying to connect.

[2011/11/07 07:23:53,  1] smbd/service.c:676(make_connection_snum)
  create_connection_server_info failed: NT_STATUS_ACCESS_DENIED

This is clearly the problem, but I don't know why it's happening. The user and pass I'm using are good, and it was working before the upgrade. I did find this in log.winbindd-idmap:

[2011/11/07 07:14:12,  1] winbindd/idmap.c:321(idmap_init_domain)
  idmap initialization returned NT_STATUS_UNSUCCESSFUL
[2011/11/07 07:23:40,  0] winbindd/idmap.c:201(smb_register_idmap_alloc)
  idmap_alloc module tdb already registered!
[2011/11/07 07:23:40,  0] winbindd/idmap.c:149(smb_register_idmap)
  Idmap module passdb already registered!
[2011/11/07 07:23:40,  0] winbindd/idmap.c:149(smb_register_idmap)
  Idmap module nss already registered!
[2011/11/07 07:23:40,  1] winbindd/idmap_tdb.c:214(idmap_tdb_load_ranges)
  idmap uid missing
[2011/11/07 07:23:40,  0] winbindd/idmap_tdb.c:287(idmap_tdb_open_db)
  Upgrade of IDMAP_VERSION from -1 to 2 is not possible with incomplete configur
ation
[2011/11/07 07:23:40,  1] winbindd/idmap.c:321(idmap_init_domain)
  idmap initialization returned NT_STATUS_UNSUCCESSFUL

log.smbd

[2011/11/06 20:01:29,  0] smbd/server.c:1069(main)
  smbd version 3.4.7 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2009
[2011/11/06 20:01:29,  0] printing/print_cups.c:103(cups_connect)
  Unable to connect to CUPS server localhost:631 - Connection refused
[2011/11/06 20:01:29,  0] printing/print_cups.c:103(cups_connect)
  Unable to connect to CUPS server localhost:631 - Connection refused
[2011/11/06 20:01:29,  0] smbd/server.c:1115(main)
  standard input is not a socket, assuming -D option

log.nmbd

[2011/11/06 13:40:55,  0] nmbd/nmbd.c:854(main)
  nmbd version 3.4.7 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2009

smb.conf, most of which is stock

[global]
   workgroup = MyGroup   # edited
   server string = %h server (Samba, Ubuntu)
   dns proxy = no
   use sendfile = yes   # edited
   log file = /var/log/samba/log.%m
   max log size = 1000
   syslog = 0
   panic action = /usr/share/samba/panic-action %d
   security = user   # edited
   encrypt passwords = true
   passdb backend = tdbsam
   obey pam restrictions = yes
   unix password sync = yes
   passwd program = /usr/bin/passwd %u
   passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
   pam password change = yes
   map to guest = bad user
   guest account = myshareuser   # edited
   usershare allow guests = yes

[printers]
   comment = All Printers
   browseable = no
   path = /var/spool/samba
   printable = yes
   guest ok = no
   read only = yes
   create mask = 0700

[print$]
   comment = Printer Drivers
   path = /var/lib/samba/printers
   browseable = yes
   read only = yes
   guest ok = no

# added
[share]
path = /mnt/storage/share
force user = myshareuser
force group = myshareuser
read only = No
create mask = 0777
directory mask = 0777
guest only = No
guest ok = No

[backup]
path = /mnt/storage/backup
force user = myshareuser
force group = myshareuser
read only = No
create mask = 0777
directory mask = 0777
guest only = No
guest ok = No
share|improve this question
    
You need to troubleshoot. Is smbd running? Is nmbd running? What's in the log files? –  David Schwartz Nov 7 '11 at 5:38
    
@DavidSchwartz Thanks for the hint, I've added some details above. –  Jay Sheridan Nov 7 '11 at 13:40

4 Answers 4

up vote 1 down vote accepted

Could be a corrupt passdb.tdb file. If you remove it and restart Samba can you add users?

share|improve this answer
    
I found more detail on this problem here: forums.debian.net/viewtopic.php?f=5&t=54952 –  Jay Sheridan Nov 10 '11 at 2:58

Try following:

sudo smbpasswd -L -a username   (set a password)
sudo smbpasswd -L -e username   (enable user)

You can also add the content of /etc/samba/smb.conf with the problem details. Besides, you can give a try with webmin. for details check the below link:

webmin

share|improve this answer
    
The first line fails with "Unable to modify TDB passwd: NT_STATUS_UNSUCCESSFUL!", and the second fails with "Failed to find user myshareuser in passdb backend." (which I assume is because the first failed). –  Jay Sheridan Nov 8 '11 at 1:24
    
Try below solution...don't hesitate to get back if you find any confusion :) –  BluE Sky Nov 8 '11 at 12:07
    
Can you try with adding a new user like - sudo adduser testuser (set your password & necessary info). then sudo smbpasswd -a testuser (do not set any password here, just keep pressing enter), this should give an output like the Added user testuser –  BluE Sky Nov 9 '11 at 5:55
    
It wouldn't add with a new user. Turns out deleting the /var/lib/samba/passdb.tdb file allowed me to run these commands successfully. –  Jay Sheridan Nov 10 '11 at 3:00

Okay. If you have not got the solution yet, please try below:

sudo system-config-samba

It will give you a gui like:

enter image description here

enter image description here

enter image description here

enter image description here

check the 'preferences' box (Samba settings & samba users). You can add your share from File--> add share

Besides,if still the problem exists then you can also try to edit /etc/samba/smb.conf file like below, i guess which may solve your problem :

usershare allow guests = yes
security = user
guest ok = yes
guest account = exampleuser 
username map = /etc/samba/smbusers


# added
[share]
path = /mnt/storage/share
valid users = myshareuser
read only = No
guest ok = yes
browseable = yes

[backup]
path = /mnt/storage/backup
valid users = myshareuser
read only = No
guest ok = yes
browseable = yes

Then execute the below commands:

sudo chmdo 777 /mnt/storage/share /mnt/storage/backup
sudo stop smbd
sudo start smbd

Now check whether the share works :D

For interactive user authetication following may work

Add an user in the system & give the password

sudo adduser testsamba

Add the user to Samba & keep the password blank when asked here again

sudo smbpasswd -a testsamba

Map the windows user

sudo vi /etc/samba/smbusers

the file should contain like below:

testsamba = windowsuserSample

Do the necessary configuration with the GUI as before

sudo system-config-samba

restart samba service

sudo service smbd restart
share|improve this answer
    
Adding 'valid users = myshareuser' and 'guest ok = yes' does allow the share to be accessed, but with out a password. I was hoping to require password access to at least one of them. –  Jay Sheridan Nov 8 '11 at 13:25
    
Have u checked the "system-config-samba"??? there is an option for your desired user mapping. You can map a windows user through that. –  BluE Sky Nov 8 '11 at 16:16
    
Plz check the added part & don't hesitate to get back soon :D –  BluE Sky Nov 8 '11 at 18:34
    
I don't actually have any GUI for this install, but those instructions could be helpful to others. Thanks for trying to help me step through this. –  Jay Sheridan Nov 10 '11 at 3:02
    
Is your problem solved? –  BluE Sky Nov 10 '11 at 13:37

@Jay Sheridan, I have tried the following & it should work. It's just a summery version of the last reply. You can check it.

  1. Install samba server, In the terminal type the command:
sudo apt-get install samba smbfs
  1. Make a configuration for share:

sudo vi /etc/samba/smb.conf

edit like this :

[global]

security = USER hosts allow =

[homes]

comment = Home Directories

browseable = no

writable = yes

[share]

comment = Unixmen File Server

path = /share/

force user = samba

force group = samba

read only = No

hosts allow =

add a user (For example: unixmenuser to the system, in the terminal type the command :

root@unixmen-desktop:~# adduser unixmenuser

sudo smbpasswd -a unixmenuser

the output of the second command should be like below


Output

New SMB password:

Retype new SMB password:

Added user unixmenuser.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.