LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Samba won't authenticate users (https://www.linuxquestions.org/questions/linux-server-73/samba-wont-authenticate-users-879378/)

Teckno 05-07-2011 02:59 PM

Samba won't authenticate users
 
I'm just trying to set up a simple file server on my OpenIndiana box, but no matter what tutorial or smb.conf setting I seem to try I get the same problem.

First, my latest smb.conf:
Code:

[global]
        netbios name = CASPER
        workgroup = LAN
        server string = File Server
        log file = /var/samba/log/smbd.log
        max log size = 100
        encrypt passwords = yes
        smb passwd file = /etc/samba/smbpasswd
        security = share
        unix password sync = Yes
        passwd program = /usr/bin/passwd %u
        passwd chat = *New*UNIX*password* %n\n *ReType*new*UNIX*password* %n\n *passwd:*all*authentication*tokens*updated*successfully*       
        socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192       

[media]
        comment = Media Files
        path = /share/media
        public = yes
        read only = no
               
[sam]
        comment = Sams Files
        path = /share/userfiles/sam
        valid users = sam
        public = no
        writable = yes
        printable = no

I also made sure to add both the unix user and smb user to the server. I have the same user name "sam" on my windows desktop, and ubuntu laptop, and I used the same password. Ive tested the accounts and they seem to work fine. I can login to the unix account and samba shows that it has a user named sam

The problem:
The server and shares show up just fine, and the media share is readable (not writable but that most likely just a permission thing and not the issue at hand). The problem is with the private share "sam", heres what happens:

Local Test:
[QUOTE]sam@casper:~$ /usr/bin/smbclient //192.168.0.1/sam
Enter sam's password:
Connection to 192.168.0.1 failed (Error NT_STATUS_CONNECTION_REFUSED)[/CODE]

From my Ubuntu laptop:
Quote:

sam@osaka:~$ smbclient //192.168.1.13/sam
Enter sam's password:
session setup failed: NT_STATUS_LOGON-FAILURE
And from my Windows Vista desktop I just get a login unsuccessful message.

My /var/samba/log/smbd.log is filled with these:
Code:

[2011/05/07 13:46:32.075667,  1] smbd/service.c:677(make_connection_snum)
  create_connection_server_info failed: NT_STATUS_WRONG_PASSWORD
[2011/05/07 13:46:32.079670,  1] smbd/service.c:677(make_connection_snum)
  create_connection_server_info failed: NT_STATUS_WRONG_PASSWORD
[2011/05/07 13:46:32.086242,  1] smbd/service.c:677(make_connection_snum)
  create_connection_server_info failed: NT_STATUS_WRONG_PASSWORD

and yes, I triple checked all the passwords.


From my tests it seems that samba refuses to use any sort of user other then the guest account.

I tried it with "security = user" but run into the same issue, just when I connect to the server instead of the share, so it efectivlly blocks me from the media share as well.

Im probably missing something simple thats preventing the authentication, anyone care to point it out?

Thank you

Teckno 05-09-2011 01:25 PM

Ive tried all I can think of, is there any other test I could run to gather more information on this?

Teckno 05-11-2011 01:00 PM

Does anyone have any idea what other files or programs are used in the process?

That way I can go though them one by one and check them out.

Teckno 05-14-2011 02:27 PM

Can someone at least confirm that the smb.conf looks good (Im not missing anything)?

Teckno 05-25-2011 01:44 PM

Ok, this is weird. This is only one of three forums I posted this to and I have yet to get a reply from anyone. Does no one use Samba? should I be looking at something else?

I know this is possible since thats the whole point of samba authentication, and Ive followed the examples to the letter. What the hell is going on with this thing?

catkin 05-25-2011 02:07 PM

Did you run smbpasswd?

Teckno 05-26-2011 01:26 PM

Quote:

Originally Posted by catkin (Post 4366819)
Did you run smbpasswd?

weird, I could have sworn I ran this before but I don't recall getting this error before:

Code:

sam@casper:~$ /usr/bin/smbpasswd
Old SMB password:
New SMB password:
Retype new SMB password:
SAMR connection to machine NT_STATUS_ACCESS_DENIED failed. Error was 127.0.0.1, but LANMAN password changed are disabled

Ok, ran as root:
Code:

# smbpasswd -a sam
New SMB password:
Retype new SMB password:

no errors came up but I still cant access the share, sames issues as before

catkin 05-28-2011 05:10 AM

Probably a silly question but did you give sam the same password with smbpasswd that sam has on Windows?

Probably doesn't matter but are the Windows systems in workgroup LAN?

To minimise/canonicalise the problem information, what is the output of testparm smb.conf?

NFS would be a better choice than Samba for your Ubuntu system.

Teckno 05-28-2011 07:04 PM

Yes and yes, same password, and the workgroup is LAN

However...

Code:

# testparm smb.conf
Load smb config files from smb.conf
rlimit_max: rlimit_max (256) below minimum Windows limit (16384)
params.c:OpenConfFile() - Unable to open configuration file "smb.conf":
        No such file or directory
Error loading services.

:confused:

catkin 05-28-2011 11:58 PM

Sorry for not being more explicit. Assuming smb.conf is in /etc/samba, you need either
Code:

cd /etc/samba
testparm smb.conf

or
Code:

testparm /etc/samba/smb.conf

Perplexed 10-01-2012 09:36 AM

System Date
 
I realize this is an old thread, but it showed up high in search results and seems to lack a conclusion.

I had similar problems, but setting the system date on the serving CentOS box to today's date (from 2004!) may have been the solution for me, and the reason why clients weren't being happily connected.

Nick_C 10-29-2012 04:51 AM

I know this is an old thread but I just came accross it while trying to solve the same problem. So for the benefit of others that might happen accross it.

The answer:
Problem is caused by SELinux, it can be turned off temporarily with 'setenforce 0', if that works turn it back on with 'setenforce 1' and correct the problem properly by setting the context of the Samba share directory to samba_share_t.

Hope that might help.

EastLight 03-14-2013 02:10 PM

I know this is an old thread, but it continues to rank highly in search results for this issue.

I had the same problem - when Samba security was set to 'share' on my Linux box, authentication failed when attempting to access a password protected share from Windows 7, even though username and password were both entered correctly.

A partial clue came from a Microsoft support article named 'Cannot Connect to Password-Protected Share on Windows 95/98 Computer', since Win95/98 also use 'share level' security.

Basically, to access the password-protected Samba share in Windows 7, when the 'Enter Network Password' box pops up, instead of just entering the Linux user account name you need to enter name of Linux box\Linux user account name.
So if the Linux box is named 'dragon', the user account is named 'bob' and the password is 'penguin' you would enter:
Username: dragon\bob
Password: penguin

This worked for me - hope it helps others too.

zafar_dandoti 03-15-2013 02:16 AM

have you checked the actual directory permissions on samba server...?
does user sam have read/write access to directories ?
what are directory permissions please elaborate ..

zafar_dandoti 03-15-2013 02:25 AM

probably you must have created directories by becoming root so the directories are owned by user root!

modify the directory permissions so that samba users can read/write to them..

ronramiro 11-29-2013 09:43 AM

solved
 
Quote:

Originally Posted by zafar_dandoti (Post 4912008)
probably you must have created directories by becoming root so the directories are owned by user root!

modify the directory permissions so that samba users can read/write to them..

I had the same message: error NT_STATUS_WRONG_PASSWORD

To access local and remote (windows) I change smb.conf file in Networking Section:
interfaces = 127.0.0.0/8 eth0
for # interfaces = 127.0.0.0/8 eth0

and:
bind interfaces only = yes
for # bind interfaces only = yes


hope this help

Bruce from Canada 03-13-2014 04:21 PM

F20 and Samba - multiple complaints existing.
 
I have recently installed F20 on a new machine. I have also had problems with F20 and Samba.

On researching in various places and doing some of my own experimenting, I see that this is not a single issue. This also correlates with the diverse plethora of complaints I have seen.

I was able to get Filezilla to work through Samba, but so far not Nautilus.

For now I have a work-around that fills the bill temporarily, but that is complex and hardware intensive. I doubt if many users would like to deal with that approach.

Part of this is a fault in the way SELINUX handles authenticating of Samba, and I suspect the problem, or at least part of it is hard coded, and may have to wait until the major developers do a fully compiled respin of the pair as an RPM. That will take a lot of developers' time, so it may never appear in F20.

I have heard it posted that F21 is to have a new core, and so is not expected to arrive until (somebody's guess) about august or September or 2014.

Given what happened with the release of F18, I would be little surprised if that didn't result in F21 being months later than that.

I suggest people experiencing problems with any of these issues do a lot of research, or see if they can set up the whole thing on NFS, adding what they may need to their windows users to access through NFS.

It is also possible that the problem might bre solved with a NAS box that can be accessed simultaneously from an embedded Samba server and an embedded NFS server simultaneously, or by using 2 NAS boxes, bilaterally cross-synced, one for each.

In such a case, the traffic is apt to be heavy, so the 2 NAS boxes might well be placed on the Lower side of a Gb. managed switch, so as not to impose the cross-sync traffic on the main network.

Bruce from Canada

[QUOTE=Teckno;4349454]I'm just trying to set up a simple file server on my OpenIndiana box, but no matter what tutorial or smb.conf setting I seem to try I get the same problem.

First, my latest smb.conf:
Code:

[global]
    netbios name = CASPER
    workgroup = LAN
    server string = File Server
    log file = /var/samba/log/smbd.log
    max log size = 100
    encrypt passwords = yes
    smb passwd file = /etc/samba/smbpasswd
    security = share
    unix password sync = Yes
    passwd program = /usr/bin/passwd %u
    passwd chat = *New*UNIX*password* %n\n *ReType*new*UNIX*password* %n\n *passwd:*all*authentication*tokens*updated*successfully*   
    socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192   

[media]
    comment = Media Files
    path = /share/media
    public = yes
    read only = no
       
[sam]
    comment = Sams Files
    path = /share/userfiles/sam
    valid users = sam
    public = no
    writable = yes
    printable = no

I also made sure to add both the unix user and smb user to the server. I have the same user name "sam" on my windows desktop, and ubuntu laptop, and I used the same password. Ive tested the accounts and they seem to work fine. I can login to the unix account and samba shows that it has a user named sam

The problem:
The server and shares show up just fine, and the media share is readable (not writable but that most likely just a permission thing and not the issue at hand). The problem is with the private share "sam", heres what happens:

Local Test:
Quote:

sam@casper:~$ /usr/bin/smbclient //192.168.0.1/sam
Enter sam's password:
Connection to 192.168.0.1 failed (Error NT_STATUS_CONNECTION_REFUSED)[/CODE]

From my Ubuntu laptop:


And from my Windows Vista desktop I just get a login unsuccessful message.

My /var/samba/log/smbd.log is filled with these:
Code:

[2011/05/07 13:46:32.075667,  1] smbd/service.c:677(make_connection_snum)
  create_connection_server_info failed: NT_STATUS_WRONG_PASSWORD
[2011/05/07 13:46:32.079670,  1] smbd/service.c:677(make_connection_snum)
  create_connection_server_info failed: NT_STATUS_WRONG_PASSWORD
[2011/05/07 13:46:32.086242,  1] smbd/service.c:677(make_connection_snum)
  create_connection_server_info failed: NT_STATUS_WRONG_PASSWORD

and yes, I triple checked all the passwords.


From my tests it seems that samba refuses to use any sort of user other then the guest account.

I tried it with "security = user" but run into the same issue, just when I connect to the server instead of the share, so it efectivlly blocks me from the media share as well.

Im probably missing something simple thats preventing the authentication, anyone care to point it out?

Thank you

Ser Olmy 03-13-2014 04:53 PM

Since your post quoted the OP of this ancient thread:
Quote:

Originally Posted by Bruce from Canada (Post 5134078)
Code:

[global]
    netbios name = CASPER
    workgroup = LAN
    server string = File Server
    log file = /var/samba/log/smbd.log
    max log size = 100
    encrypt passwords = yes
    smb passwd file = /etc/samba/smbpasswd
    security = share


IMPORTANT: "security = share" is deprecated in (and was recently removed from) Samba and has been unsupported on the Windows platform since around 2001. It was a bad idea to use "security = share" even back when this thread was started. Windows Vista/7/8 won't know what to do when connecting to a share using this authentication mode.

Use "security = user" instead.


All times are GMT -5. The time now is 06:21 AM.