LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-13-2013, 12:44 PM   #1
amirgol
Member
 
Registered: Apr 2011
Posts: 35

Rep: Reputation: 0
Question Unable to access Samba share on Debian Jessie


Due to a disk failure, I had to reinstall my home server, running a very minimal, CLI only Debian Jessie. I'm sure I've configured Samba just like I had a couple of months ago, but this time, the share in inaccessible.

From a Windows computer, under the same credentials as the share, I used to access the server's IP and see the share (\\192.168.200.250\), now all I get is "Windows cannot access \\192.168.200.250". Attempting to access the share itself (\\192.168.200.250\Backup\), I'm asked for credentials and then get the same error message. On another Windows computer, with a different username, I used to access the server's IP and then being asked for the credentials, now I get the same "cannot access" error immediately.

When I attempt to access a share, a log file with the client's IP is created, but it's always zero-sized, even with "log level = 3". Samba daemons look... weird:

Code:
root@Server:~# ps -ef | grep mbd
root      2868     1  0 19:52 ?        00:00:00 /usr/sbin/nmbd -D
root      2897     1  0 19:52 ?        00:00:00 /usr/sbin/smbd -D
root      2947  2897  0 19:52 ?        00:00:00 /usr/sbin/smbd -D
root      2954  2897  0 19:59 ?        00:00:00 /usr/sbin/smbd -D
root      3096  3051  0 20:08 pts/0    00:00:00 grep mbd
Why do smbd pid 2897 spawns another pair of smbds? And with "log level = 3", shouldn't the daemons have "-D 3"? When I restart Samba:

Code:
root@Server:~# /etc/init.d/samba restart
[ ok ] Stopping NetBIOS name server: nmbd.
[ ok ] Starting NetBIOS name server: nmbd.
[ ok ] Stopping SMB/CIFS daemon: smbd.
[ ok ] Starting SMB/CIFS daemon: smbd.
[ ok ] Stopping Samba AD DC daemon: samba.
root@Server:~# ps -ef | grep mbd
root      3174     1  0 20:24 ?        00:00:00 /usr/sbin/nmbd -D
root      3229     1  0 20:24 ?        00:00:00 /usr/sbin/smbd -D
root      3239  3229  0 20:24 ?        00:00:00 /usr/sbin/smbd -D
root      3282  3051  0 20:24 pts/0    00:00:00 grep mbd
Now I have one extra smbd process. And what's with the AD DC daemon? I don't recall seeing it before. Could be a new feature of ver. 4?

The nmbd log has nothing interesting to offer. smbd, on the other hand:

Code:
root@Server:~# tail -5 /var/log/samba/log.nmbd
[2013/12/13 20:24:09,  0] ../source3/nmbd/nmbd.c:57(terminate)
  Got SIGTERM: going down...
[2013/12/13 20:24:11,  0] ../source3/nmbd/nmbd.c:895(main)
  nmbd version 4.0.13-Debian started.
  Copyright Andrew Tridgell and the Samba Team 1992-2012
root@Server:~# tail -10 /var/log/samba/log.nmbd
[2013/12/13 17:52:06,  0] ../source3/nmbd/nmbd.c:57(terminate)
  Got SIGTERM: going down...
[2013/12/13 19:52:54,  0] ../source3/nmbd/nmbd.c:895(main)
  nmbd version 4.0.13-Debian started.
  Copyright Andrew Tridgell and the Samba Team 1992-2012
[2013/12/13 20:24:09,  0] ../source3/nmbd/nmbd.c:57(terminate)
  Got SIGTERM: going down...
[2013/12/13 20:24:11,  0] ../source3/nmbd/nmbd.c:895(main)
  nmbd version 4.0.13-Debian started.
  Copyright Andrew Tridgell and the Samba Team 1992-2012
root@Server:~# tail -10 /var/log/samba/log.smbd
[2013/12/13 17:52:06.975682,  0] ../lib/util/pidfile.c:153(pidfile_unlink)
  Failed to delete pidfile /var/run/samba/smbd.pid. Error was No such file or directory
[2013/12/13 19:52:55,  0] ../source3/smbd/server.c:1201(main)
  smbd version 4.0.13-Debian started.
  Copyright Andrew Tridgell and the Samba Team 1992-2012
[2013/12/13 20:24:11.692685,  0] ../lib/util/pidfile.c:153(pidfile_unlink)
  Failed to delete pidfile /var/run/samba/smbd.pid. Error was No such file or directory
[2013/12/13 20:24:13,  0] ../source3/smbd/server.c:1201(main)
  smbd version 4.0.13-Debian started.
  Copyright Andrew Tridgell and the Samba Team 1992-2012
No such file? It's there!

Code:
root@Server:~# ls -l /var/run/samba/smbd.pid
-rw-r--r-- 1 root root 5 Dec 13 20:24 /var/run/samba/smbd.pid
How about my smb.conf?

Quote:
root@Server:~# testparm
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[Media]"
Processing section "[Software]"
Processing section "[Backup]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions

[global]
server string = Home Server
server role = standalone server
map to guest = Bad User
obey pam restrictions = Yes
pam password change = Yes
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
unix password sync = Yes
syslog = 0
log file = /var/log/samba/log.%m
max log size = 1000
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65536
load printers = No
printcap name = /dev/null
local master = No
dns proxy = No
panic action = /usr/share/samba/panic-action %d
idmap config * : backend = tdb

[Backup]
comment = Backup files
path = /mnt/storage/Backup
valid users = amir
write list = amir
read only = No
create mask = 0660
directory mask = 0770
testparm has no complaints.

Can I reach the share from my Windows PC, called "pc" (imagination is for the weak! ;-) )? Seems like I can:

Code:
root@Server:~# testparm -s /etc/samba/smb.conf pc 192.168.200.185
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[Backup]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Allow connection from pc (192.168.200.185) to Backup
How about accessing the share locally?

Code:
amir@Server:~$ smbclient '\\192.168.200.250\Backup'
Enter amir's password:
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 4.0.13-Debian]
tree connect failed: NT_STATUS_IO_TIMEOUT
This time, the log file has some content in it:

Code:
root@Server:~# cat /var/log/samba/log.__1
[2013/12/13 16:37:48.468455,  0] ../source3/smbd/process.c:264(read_packet_remainder)
  read_fd_with_timeout failed for client ::1 read error = NT_STATUS_END_OF_FILE.
Looks like it used IPv6 instead of IPv4, but it should've still worked. That, as you can see from the timestamp, was several hours ago. Now, however:

Code:
amir@Server:~$ smbclient '\\192.168.200.250\Backup'
Enter amir's password:
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 4.0.13-Debian]
smb: \> ls
  .                                   D        0  Wed Sep 18 01:26:55 2013
  ..                                  D        0  Fri Dec 13 19:52:46 2013

                65535 blocks of size 33553920. 65535 blocks available
smb: \> exit
And no log file! Still, the share in inaccessible from Windows. There's no firewall on the Windows computers nor on the Debian server and all machines are in the same subnet.

I've no idea what is going on, any help would be most welcome.
 
Old 12-14-2013, 06:20 AM   #2
allend
Senior Member
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware-current
Posts: 4,539

Rep: Reputation: 1419Reputation: 1419Reputation: 1419Reputation: 1419Reputation: 1419Reputation: 1419Reputation: 1419Reputation: 1419Reputation: 1419Reputation: 1419
Did you rebuild your samba password database backend? Perhaps check with 'pdbedit -L', run as root.
 
Old 12-15-2013, 04:43 PM   #3
amirgol
Member
 
Registered: Apr 2011
Posts: 35

Original Poster
Rep: Reputation: 0
Thanks. Yes, I have.

But I've just managed to make the damned thing work! Yay me! B-)

Apparently, using 'testparm -s' to test the smb.conf for correctness and at the same time produce a clean version of it (as in 'testparm -s /etc/samba/smb.conf.master > /etc/samba/smb.conf') might not be such a good idea after all. Some valid setting simply vanished in the process, one of them the log level. So even when I set 'log level = 10' in the smb.conf.master file, th actual smb.conf had no such line, hence Samba ran with log level = 0. Odd.

Once I figured that out and set the log level on the smb.conf file directly, I could see the error quite clearly in the logs:

Code:
[2013/12/16 00:22:39.104328,  3] ../source3/smbd/service.c:612(make_connection_snum)
  Connect path is '/tmp' for service [IPC$]
[...]
[2013/12/16 00:22:39.105475,  4] ../source3/smbd/vfs.c:838(vfs_ChDir)
  vfs_ChDir to /tmp
[2013/12/16 00:22:39.105501,  3] ../source3/smbd/service.c:197(set_current_service)
  chdir (/tmp) failed, reason: Permission denied
Well, I had /tmp as 770 so 'amir' which was not the owning user or a member of the owning group, had no access to it. chmod-ing it to 777 allowed this user access to this directory and allowed me to open shares from other computer. Hurray!

But why on earth does Samba needs to access /tmp as the user attempting to access the shared directory? Well, that's why Google is for:
https://lists.samba.org/archive/samb...ay/027959.html

So how come I was able to access shares before? Well, I guess I had /tmp as 777 or perhaps had TMPDIR pointing to some other directory with the proper permissions. Can't tell as that HD had already died.

And all it took was three days of hair pooling.
 
  


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
[SOLVED] Samba share access from XP works - Win 7 share access disappear after about 3 minutes rylan76 Linux - Networking 1 11-03-2012 06:00 AM
Windows 7 unable to access Samba share kaplan71 Linux - Software 2 08-11-2011 04:33 AM
Debian 5.0.5 AMD64 unable to access Windows 7 shares via Samba/cifs csterling Linux - Server 4 06-07-2011 06:31 AM
Unable to enable write access to Samba share stonehurstX11 Linux - Server 1 08-14-2010 07:20 PM
Unable to access Samba share on CentOS 5.4 from windows XP or Vista kphannan Linux - Server 5 01-26-2010 09:08 AM


All times are GMT -5. The time now is 12:42 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