Книга: Fedora™ Unleashed, 2008 edition

Starting the smbd Daemon

Starting the smbd Daemon

Now that your smb.conf file is correctly configured, you can start your Samba server daemon. You can do so with the /usr/sbin/smbd command, which (with no options) starts the Samba server with all the defaults. The most common option you will change in this command is the location of the smb.conf file; you change this option if you don't want to use the default location /etc/smb/smb.conf. The -s option allows you to change the smb.conf file Samba uses; this option is also useful for testing whether a new smb.conf file actually works. Another useful option is the -l option, which specifies the log file Samba uses to store information.

To start, stop, or restart Samba from the command line, use the service command, the system-config-services client, or the /etc/rc.d/init.d/smb script with a proper keyword, such as start, like so:

# /etc/rc.d/init.d/smb start

Using the smbstatus Command

The smbstatus command reports on the current status of your Samba connections. The syntax is as follows:

/usr/bin/smbstatus [options]

Table 19.2 shows some of the available options.

TABLE 19.2 smbstatus Options

Option Result
-b Brief output.
-d Verbose output.
-s /path/to/config Used if the configuration file used at startup is not the standard one.
-u username Shows the status of a specific user's connection.
-p Lists current smb processes. This can be useful in scripts.

Connecting with the smbclient Command

The smbclient command allows users on other Linux hosts to access your smb shares. You cannot mount the share on your host, but you can use it in a way that is similar to that you'd use with an FTP client. Several options can be used with the smbclient command.

The most frequently used is -I, followed by the IP address of the computer to which you are connecting. The smbclient command does not require root access to run:

smbclient -I 10.10.10.20 -U username%password

This gives you the following prompt:

smb: <current directory on share>

From here, the commands are almost identical to the standard UNIX/Linux FTP commands. Note that you can omit a password on the smbclient command line. You are then prompted to enter the Samba share password.

Оглавление книги


Генерация: 1.149. Запросов К БД/Cache: 3 / 1
поделиться
Вверх Вниз