An Overview of Samba # service smb stop Shutting down SMB services: [ OK ] Shutting down NMB services: [ OK ] You get the idea. Note, however, that this script only allows you to control the service manually. It doesn’t allow you to configure the service to start automatically on boot-up - for that, you need the Service Configuration GUI that we described above. Samba Configuration Files and Utilities We won’t take a look at every single item that is installed during the process described above, but it is worth pointing out some of the most important files, both to get an idea of Samba’s capabilities and because we’ll be using some of these files and programs later in this section. Specifically of interest to us here are Samba’s configuration files and programs. Samba’s configuration files are contained in the directory /etc/samba. Here’s a brief description of the the Samba configuration files that you’ll find there: Configuration File Description smb.conf This is the main configuration file for Samba. lmhosts This contains Samba’s NetBIOS-to-IP address mappings. secrets.tdb This is the Samba secrets database. It stores private information such as the local SID and machine trust password. It is generated by machine and cannot be read in a text editor. smbusers This is a text file that maps your Linux system’s users to various SMB-specific usernames. smbpasswd This is an encrypted password file. The format of this file is very similar to that of the passwd file we met in Chapter 8. This file doesn’t exist when you first install Samba, but is created when you add Samba users. In order to work with file servers through Samba, we can use its many programs. Here’s a list of some of the most important utilities provided by Samba. They’re all contained in the directory /usr/bin, and we’ll be using some of them later in this section: Program Purpose smbclient This is an FTP-like client, used to access SMB/CIFS resources on a file server. smbadduser This is a script, used for adding Samba users. It updates the smbusers and smbpasswd files. smbpasswd This changes a Samba user’s SMB password. It is similar to the Unix passwd command that we met in Chapter 8. smbmount This is used to mount an SMB filesystem. smbumount This is used to unmount an SMB file system. smbstatus This lists the current Samba connections. testparm This checks the smb.conf configuration file for correctness. nmblookup This is used to query NetBIOS names and map them to IP addresses in a network using NetBIOS over TCP/IP. In addition, we’ll also make use of the script /etc/rc.d/init.d/smb, which we use to start and stop the Samba file service. 294
Quick Hint: If you are looking for cheap and reliable provider to host and run your servlet application check Vision servlet hosting plans