Exploring Samba's new registry-based configuration
net (rpc) registry
Samba's swiss army knife net basically has built-in command line versions of regedit: net registry to access the local registry and net rpc registry to access a remote registry over RPC. Although these tools are almost as clumsy as regedit, they do allow the administrator to produce more convenient custom tools with Unix shell scripts. Table 2 shows the available subcommands of net registry, and Listing 3 demonstrates an example of configuration tasks. The use of net rpc registry is completely analogous – you just call it as net -Uuser rpc registry … or even net -Uuser%password rpc registry … when it is too inconvenient to type the password at the prompt for each call.
Listing 3
Example net registry Session
net conf
net registry is pretty chatty and clumsy for day-to-day administration tasks, so net now comes with a dedicated registry configuration interface offered by the new net conf command. Table 3 provides a summary of net conf options.
The net conf list command outputs the complete configuration in smb.conf format, whereas net conf import imports a smb.conf text file into the registry, dropping all previous data. This way, one can easily switch back and forth between registry- and text-based configuration if necessary (Listing 4).
Listing 4
Example net conf Session
Writing GUIs
An abstraction layer called libsmbconf presents all necessary methods to access Samba's registry configuration from C code. net conf and the server use libsmbconf to access the registry. The Samba project site has more details on the API [5]. libsmbconf is not published as a shared library because of linking dependencies to a lot of Samba internal code that is not yet properly chopped into shared libraries. Eventually the idea is to release libsmbconf so that it's easy to write third-party applications to configure Samba. A first example application called netdomjoin-gui is available with the Samba code. netdomjoin-gui is a Gtk program that joins your Samba into an active directory domain, modifying the registry configuration accordingly. It is modeled on the native Windows join dialog. The code is under lib/netapi/examples/netdomjoin-gui in Samba's source tree.
To compile the application, use make -C lib/netapi/examples; afterwards, you will find the binary in lib/netapi/examples/bin/netdomjoin-gui. Starting with a smb.conf file that contains config backend = registry and an empty registry configuration, the administrator calls netdomjoin-gui (Figure 3). Listing 5 shows the registry configuration after the process is finished.
Listing 5
Registry Configuration after the Join
« Previous 1 2 3 4 Next »
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Latest Cinnamon Desktop Releases with a Bold New Look
Just in time for the holidays, the developer of the Cinnamon desktop has shipped a new release to help spice up your eggnog with new features and a new look.
-
Armbian 24.11 Released with Expanded Hardware Support
If you've been waiting for Armbian to support OrangePi 5 Max and Radxa ROCK 5B+, the wait is over.
-
SUSE Renames Several Products for Better Name Recognition
SUSE has been a very powerful player in the European market, but it knows it must branch out to gain serious traction. Will a name change do the trick?
-
ESET Discovers New Linux Malware
WolfsBane is an all-in-one malware that has hit the Linux operating system and includes a dropper, a launcher, and a backdoor.
-
New Linux Kernel Patch Allows Forcing a CPU Mitigation
Even when CPU mitigations can consume precious CPU cycles, it might not be a bad idea to allow users to enable them, even if your machine isn't vulnerable.
-
Red Hat Enterprise Linux 9.5 Released
Notify your friends, loved ones, and colleagues that the latest version of RHEL is available with plenty of enhancements.
-
Linux Sees Massive Performance Increase from a Single Line of Code
With one line of code, Intel was able to increase the performance of the Linux kernel by 4,000 percent.
-
Fedora KDE Approved as an Official Spin
If you prefer the Plasma desktop environment and the Fedora distribution, you're in luck because there's now an official spin that is listed on the same level as the Fedora Workstation edition.
-
New Steam Client Ups the Ante for Linux
The latest release from Steam has some pretty cool tricks up its sleeve.
-
Gnome OS Transitioning Toward a General-Purpose Distro
If you're looking for the perfectly vanilla take on the Gnome desktop, Gnome OS might be for you.