Samba Smbd 3.x - 4.x

0 views
Skip to first unread message

Katina Piccirilli

unread,
Aug 5, 2024, 1:36:44 AM8/5/24
to tiofisenme
Ihad the same problem and solved it by moving /etc/samba/smb.conf.default to /etc/samba/smb.conf and re-adding my old config bit by bit. I couldn't track down exactly what was causing the issue but I was able to get samba to start again.

I ran smbd interactively with 'smbd -i' and saw an error message pointing at invalid permission on the /var/cache/samba/msg file. It should be 755 instead of the 700 in my Raspberry Pi Arch installation.


smbd [-D--daemon] [-i--interactive] [-F--foreground] [--no-process-group] [-b--build-options] [-p ] [-P ] [-d ] [--debug-stdout] [--configfile=] [--option==] [-l--log-basename ] [--leak-report] [--leak-report-full] [-V--version]


smbd is the server daemon that provides filesharing and printing services to Windows clients. The server provides filespace and printer services toclients using the SMB (or CIFS) protocol. This is compatible with the LanManager protocol, and can service LanManager clients. These include MSCLIENT 3.0 for DOS, Windows for Workgroups, Windows 95/98/ME, Windows NT, Windows 2000, OS/2, DAVE for Macintosh, and smbfs for Linux.


An extensive description of the services that the server can provide is given in the man page for the configuration file controlling the attributes of those services (see smb.conf(5). This man page will not describe the services, but will concentrate on the administrative aspects of running the server.


A session is created whenever a client requests one. Each client gets a copy of the server for each session. This copy then services all connections made by the client during that session. When all connections from its client are closed, the copy of the server for that client terminates.


The configuration file, and any files that it includes, are automatically reloaded every three minutes, if they change.One can force a reload by sending a SIGHUP to the server. Reloadingthe configuration file will not affect connections to any service that is already established. Either the user will have to disconnect from the service, or smbd killed and restarted.


If specified, this parameter causes the server to operate as a daemon. That is, it detaches itself and runs in the background, fielding requests on the appropriate port. Operating the server as adaemon is the recommended way of running smbd for servers that provide more than casual use file and print services. This switch is assumed if smbd is executed on the command line of a shell.


If this parameter is specified it causes theserver to run "interactively", not as a daemon, even if theserver is executed on the command line of a shell. Setting thisparameter negates the implicit daemon mode when run from thecommand line. smbd will only accept oneconnection and terminate. It will also log to standard output,as if the -S parameter had been given.


If specified, this parameter causesthe main smbd process to not daemonize,i.e. double-fork and disassociate with the terminal.Child processes are still created as normal to serviceeach connection request, but the main process does notexit. This operation mode is suitable for runningsmbd under process supervisors suchas supervise and svscanfrom Daniel J. Bernstein's daemontoolspackage, or the AIX process monitor.


profiling level is anumber specifying the level of profiling data to be collected.0 turns off profiling, 1 turns on counter profiling only,2 turns on complete profiling, and 3 resets all profiling data.


The higher this value, the more detail will be loggedto the log files about the activities of the server. Atlevel 0, only critical errors and serious warnings willbe logged. Level 1 is a reasonable level for day-to-dayrunning - it generates a small amount of informationabout operations carried out.


Levels above 1 will generate considerable amounts oflog data, and should only be used when investigating aproblem. Levels above 3 are designed for use only bydevelopers and generate HUGE amounts of log data, mostof which is extremely cryptic.


The file specified contains the configuration detailsrequired by the server. The information in this fileincludes server-specific information such as whatprintcap file to use, as well as descriptions of allthe services that the server is to provide. See$prefix/etc/smb.conf for more information. The defaultconfiguration file name is determined at compiletime.


Set thesmb.conf(5) option"" to value "" from thecommand line. This overrides compiled-in defaults andoptions read from the configuration file. If a name ora value includes a space, wrap whole--option=name=value into quotes.


On some systems smbd cannot change uid back to root after a setuid() call. Such systems are called trapdoor uid systems. If you have such a system, you will be unable to connect from a client (such as a PC) as two different users at once. Attempts to connect thesecond user will result in access denied or similar.


If no printer name is specified to printable services, most systems will use the value of this variable (or lp if this variable is not defined) as the name of the printer to use. This is not specific to the server, however.


Samba uses PAM for authentication (when presented with a plaintext password), for account checking (is this account disabled?) and forsession management. The degree too which samba supports PAM is restrictedby the limitations of the SMB protocol and the obey pam restrictions smb.conf(5) parameter. When this is set, the following restrictions apply:


Session Management: When not using share level security, users must pass PAM's session checks before accessis granted. Note however, that this is bypassed in share level security.Note also that some older pam configuration files may need a line added for session support.


Most messages are reasonably self-explanatory. Unfortunately, at the time this man page was created, there are too many diagnostics available in the source code to warrant describing each and every diagnostic. At this stage your best bet is still to grep the source code and inspect the conditions that gave rise to the diagnostics you are seeing.


To shut down a user's smbd process it is recommended that SIGKILL (-9) NOT be used, except as a last resort, as this may leave the sharedmemory area in an inconsistent state. The safe way to terminate an smbd is to send it a SIGTERM (-15) signal and wait for it to die on its own.


The debug log level of smbd may be raisedor lowered using smbcontrol(1) program (SIGUSR[12] signals are no longer used since Samba 2.2). This is to allow transient problems to be diagnosed, whilst still running at a normally low log level.


Note that as the signal handlers send a debug write, they are not re-entrant in smbd. This you should wait until smbd is in a state of waiting for an incoming SMB before issuing them. It is possible to make the signal handlers safe by un-blocking the signals before the select call and re-blocking them after, however this would affect performance.


Since you say that you reinstalled samba, I'm wondering if there's not something outside of that service as a possible problem. I'm wondering 3 things:

First, update your system totally

yum update all

Second, check what ports are being used to see if anything could conflict with samba

netstat - tupan

also try this for smb specific ports to see if anything else is on that port

netstat -tulpn grep 445

and double-check to make sure your firewall isn't on after a reboot

service iptables stop

also try using nmblookup to find the server.

Third, run through this checklist (if you haven't)

-HOWTO-Collection/diagnosis.html


Samba is a free software re-implementation of the SMB networking protocol, and was originally developed by Andrew Tridgell. Samba provides file and print services for various Microsoft Windows clients[5] and can integrate with a Microsoft Windows Server domain, either as a Domain Controller (DC) or as a domain member. As of version 4, it supports Active Directory and Microsoft Windows NT domains.


Samba runs on most Unix-like systems, such as Linux, Solaris, AIX and the BSD variants, including Apple macOS (Mac OS X 10.2 and greater) and macOS Server. Samba also runs on a number of other operating systems such as OpenVMS and IBM i. Samba is standard on nearly all distributions of Linux and is commonly included as a basic system service on other Unix-based operating systems as well. Samba is released under the terms of the GNU General Public License. The name Samba comes from SMB (Server Message Block), the name of the proprietary protocol used by the Microsoft Windows network file system.


Andrew Tridgell developed the first version of Samba Unix in December 1991 and January 1992, as a PhD student at the Australian National University, using a packet sniffer to do network analysis of the protocol used by DEC Pathworks server software. It did not have a formal name at the time of the first releases, versions 0.1, 0.5, and 1.0, all from the first half of January 1992; Tridgell simply referred to it as "a Unix file server for Dos Pathworks." He understood that he had "in fact implemented the netbios protocol" at the time of version 1.0 and that "this software could be used with other PC clients."[citation needed]


With a focus on interoperability with Microsoft's LAN Manager, Tridgell released "netbios for unix", observer, version 1.5 in December 1993. This release was the first to include client-software as well as a server. Also, at this time GPL2 was chosen as license.[citation needed]


Midway through the 1.5-series, the name was changed to smbserver. However, Tridgell got a trademark notice from the company "Syntax", who sold a product named TotalNet Advanced Server and owned the trademark for "SMBserver". The name "Samba" was derived by running the Unix command grep through the system dictionary looking for words that contained the letters S, M, and B, in that order (i.e. grep -i '^s.*m.*b' /usr/share/dict/words).[6]

3a8082e126
Reply all
Reply to author
Forward
0 new messages