LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-07-2018, 12:56 AM   #1
ziphem
Member
 
Registered: Feb 2004
Location: US / EU
Distribution: Fedora 20
Posts: 188

Rep: Reputation: 19
Unhappy Cannot access Samba NAS - authentication fails


I've been at this for so long it's embarrassing. I'm setting up (or trying to) an NAS so that I can store video from a security camera. I'm using Raspbian ~Debian and Samba.

After days, I've finally been able to get a Windows 10 (7?) machine see and access the server. However, I cannot get my security camera to authenticate. I'm completely stumped, frustrated, and exasperated, and am hoping someone can help point me in the right direction. Thanks!!

My smb.conf is below:

Code:
[global]
 security = domain
; security = user
    lanman auth = yes
    ntlm auth = yes
    client lanman auth = no
    client NTLMv2 auth = yes
    local master = yes
    preferred master = auto
    wins support = no
    interfaces = 127.0.0.0/8 lo wlan0
# It's on wifi
    name resolve order = bcast host
    bind interfaces only = yes
;    server role = standalone server
    server role = auto
    obey pam restrictions = 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
    load printers = no
;    username map = /etc/samba/smbusers
# Username is 2 characters
    guest ok = yes
    case sensitive = no

netbios name = Pi
; server string = The Pi File Center
workgroup = WORKGROUP
hosts allow = 192.168.0.
remote announce =
remote browse sync =
log level = 5
; server max protocol = SMB3
map to guest = Never

[cameraa]
comment = Camera Folder
browseable = yes
path = /var/www/html/cameras/Motion
writeable = Yes
create mask = 0777
directory mask = 0777
public = yes
valid users = pi

;valid users =
;guest ok = yes
;force user = pi
;force create mode = 0777
;force directory mode = 0777
I can view this in Windows network. I can access the files in bash from a different machine on the network, Fedora, with smbclient -L //192.168.0.10/Motion -U pi

I cannot view this in Fedora under "Network." Most important: the security camera does not seem to be able to access the share (when trying to test upload, it fails).

The security camera, unlike the other two systems, authenticates with required username, password, and folder.

What I've done:
- installed libpam-smbpass
- sudo smbpasswd -a pi, and also a broad sudo smbpasswd -a
- Opened my firewall to allow traffic from accessing IPs, both TCP and UDP
- Tried changing security = user (am I missing another settings?)
- A few other changes and about a million different smb.conf configurations.

I'm totally stumped, and would immensely appreciate any ideas on this. Thanks for any help!!

Last edited by ziphem; 08-07-2018 at 12:08 PM.
 
Old 08-07-2018, 06:45 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 19,522

Rep: Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135
What is the make/model of your camera? I suspect it is camera setting although if the camera is not synced to the correct time it may not transfer files to the share.

security=user should be sufficient and no need to configure a domain.
 
Old 08-09-2018, 08:12 PM   #3
ziphem
Member
 
Registered: Feb 2004
Location: US / EU
Distribution: Fedora 20
Posts: 188

Original Poster
Rep: Reputation: 19
Ok, thanks. I will try again with security=user and reboot. But to note, when I've done that, Windows tells me the network folder is not accessible.

The camera model is PNO-9080R.
 
Old 08-09-2018, 08:44 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 19,522

Rep: Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135
Quote:
I can access the files in bash from a different machine on the network, Fedora, with smbclient -L //192.168.0.10/Motion -U pi
I guess I did not pay enough attention to your post. The -L option allows you to look at what services are available on a server. Your not actually accessing any files yet. By the way the share name per your smb.conf file as posted above is cameraa not motion. In addition by default the /www/ permissions are owned by root and do not allow write access including subdirectories unless you have changed them regardless of the smb.conf file.

You also indicated that you can view the shares in Windows 7. Are you able to see/save files to the share?

Last edited by michaelk; 08-09-2018 at 08:45 PM.
 
Old 08-09-2018, 09:35 PM   #5
ziphem
Member
 
Registered: Feb 2004
Location: US / EU
Distribution: Fedora 20
Posts: 188

Original Poster
Rep: Reputation: 19
Thanks very much the quick response!

Sorry for the name / camera mismatch - that's just an error in the post. I do try to connect to camera, not motion.

From Windows, I am able to read / write the shared folder. For certainty, I've switched to directory /home/pi/whatever and then updated the folder in the camera; but the camera is still unable to access the share even with this change.

Previously, when I changed security = domain to security = user, Windows didn't prompt me for a password but just told me the share is not accessible. Am I just not waiting long enough, do I need to reboot either machine, or do I need to make another change in the conf?

Thanks!!
 
Old 08-09-2018, 09:51 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 19,522

Rep: Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135
You do need to restart samba service if you change the smb.conf file. Take a look at the log files for clues. You can add a log file directive which creates a file for each machine that connects.

log file = /var/log/samba/log.%m
 
Old 08-10-2018, 12:33 PM   #7
ziphem
Member
 
Registered: Feb 2004
Location: US / EU
Distribution: Fedora 20
Posts: 188

Original Poster
Rep: Reputation: 19
The really weird thing is that it never generated a log for the computer that connected, or did so intermittently. The firewall is disabled for that IP for TCP and UDP, so I'm thinking the camera is somehow getting stuck? But you think security = user must be the correct way to go if the camera requires authentication? I mean, if it's security = domain, is the user login still possible? What if I have both, is that possible? Thanks!!
 
Old 08-10-2018, 03:38 PM   #8
michaelk
Moderator
 
Registered: Aug 2002
Posts: 19,522

Rep: Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135Reputation: 3135
Quote:
The firewall is disabled for that IP for TCP and UDP, so I'm thinking the camera is somehow getting stuck?
Although the Windows 7 is able to read/write to the share are you sure the firewall isn't getting in the way of the camera? Have you tried disabling it completely?

It could be a protocol mismatch. Did you try setting the min protocol i.e
protocol = SMB2
 
Old 08-11-2018, 12:09 PM   #9
ziphem
Member
 
Registered: Feb 2004
Location: US / EU
Distribution: Fedora 20
Posts: 188

Original Poster
Rep: Reputation: 19
Ok thanks a lot for the feedback. I'm going to try setting this tonight and see how it works, and post the results.
 
Old 08-12-2018, 12:36 AM   #10
ziphem
Member
 
Registered: Feb 2004
Location: US / EU
Distribution: Fedora 20
Posts: 188

Original Poster
Rep: Reputation: 19
I've tried the protocol setting. I've also enabled all inbound connections on the firewall, but no luck. This is completely bizarre. I keep thinking I'm overlooking something, but I've been over the settings a million times. Is there any special Synology-like setting that exists (the user guide suggests using a Synology server)?

What's extra strange is that there doesn't even seem to be a log of the camera's connection to the server. I have debugging set to 5, so I would imagine that even if something is stopping authentication, there still should be some log of an attempted connection.
 
Old 08-12-2018, 01:35 PM   #11
ziphem
Member
 
Registered: Feb 2004
Location: US / EU
Distribution: Fedora 20
Posts: 188

Original Poster
Rep: Reputation: 19
At this point, I am convinced it is the Samsung PNO-9080R camera. I went to the camera logs and saw that I could filter by type. I took a look at logs for:
NASConnect
NASDisconnect
NASFail
NASFormat
NASFull

and there are zero logs for any of those. So it seems the camera is not even attempting to make the connection. That explains where there are zero connection logs in the server.

In case someone has a similar issue with this particular camera, I'll post the results after speaking with customer service and then close out the thread.

Thanks for the efforts to help this far, I really appreciate it.
 
Old 09-26-2018, 12:32 PM   #12
ziphem
Member
 
Registered: Feb 2004
Location: US / EU
Distribution: Fedora 20
Posts: 188

Original Poster
Rep: Reputation: 19
I've been struggling for the last 2 months to get the digital camera - Samsung / Hanwin PNO-9080R - to connect to my Samba server, which is a Raspberry Pi. It is now finally connecting, but I now see that the connection is established and some files are transferred, but then it fails and connection is shown as 'error.' I'm not sure if it has to do with large files transferred, but I have noticed some log errors. I'd really appreciate any guidance about what the culprit could be.

The IP of the server is 192.168.0.30, the IP of the camera is .4.

I've opened iptables access for the source IP:

Code:

Code:
iptables -A INPUT -s 192.168.0.4 -p tcp -j ACCEPT
iptables -A INPUT -s 192.168.0.4 -p udp -j ACCEPT
The smb.conf is:

Code:

Code:
[global]
workgroup = WORKGROUP
server string = Samba Server %v
netbios name = Pi
security = user
map to guest = bad user
dns proxy = no
    auth methods = guest, sam, winbind, ntdomain
# WINS support =yes
log file = /var/log/samba/log.%m
log level = 10
#============= Share Definitions =================
[static]
force user = pi
path = /static
browsable =yes
writable = yes
#I've tried yes and no, no difference
guest ok = no
read only = no
A snippet of the parts of the logs where I'm seeing errors or failures:
Code:

Code:
  gid_to_sid: winbind failed to find a sid for gid 1000
....
  gid_to_sid: winbind failed to find a sid for gid 999
  Failed to fetch domain sid for WORKGROUP
  LEGACY: mapping failed for sid S-1-5-21-361073667-212275926-287177481-513
  LEGACY: mapping failed for sid S-1-1-0
....
7, pid=1777, effective(0, 0), real(0, 0)] ../source3/param/loadparm.c:3998(lp_servicenumber)
  lp_servicenumber: couldn't find homes
I have done a bunch of searches and tried results to no avail (e.g., setting guest to ok, changing security, etc.). The other possibilities were a bit over my head, so perhaps someone can help me distill this.

Thanks a ton for any help on this. Once I get this working, I certainly want to share publicly in case anyone else buys this device and has these same issues.
 
Old 09-26-2018, 03:08 PM   #13
ziphem
Member
 
Registered: Feb 2004
Location: US / EU
Distribution: Fedora 20
Posts: 188

Original Poster
Rep: Reputation: 19
Whoops, removing winbind from "auth methods" clears this up. However, now the camera is telling me that I am out of storage space, though I am not.....

<Edit>
All resolved, the camera required 500MB of space, otherwise it counted the NAS as full. I'll edit to post my full results when I'm back in town next week so that anyone else having this same problem can hopefully have a solution.

Last edited by ziphem; 09-26-2018 at 06:11 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Samba AD authentication grants access for all the users TCAS Linux - Newbie 8 10-16-2015 11:04 AM
Cannot access Samba shares - using AD authentication, CentOS 6.0 rothlis Linux - Server 2 08-22-2011 12:31 PM
Samba authentication failures trying to access my Windows PC from openSUSE 11.3 ozzy24 Linux - Networking 3 08-20-2010 01:25 AM
Unable to see shares on samba server - no authentication access desired (open access) neoelf Linux - Networking 1 06-14-2009 04:18 PM
Samba returns access denied error. wbinfo -t fails. aleida Linux - Networking 2 08-18-2005 10:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration