Using SMB Client

The SMB Client program—smbclient—is used to connect your Linux machine to networked SMB servers: for example, those running Windows NT.

Smbclient is a command-line program with many options.

To display smbclient syntax:

1.
Open a terminal window.

2.
At the command prompt, type /usr/bin/smbclient | more The possible commands and flags will be piped to more and displayed one screen at a time (Figure 13.35).

Figure 13.35. Smbclient runs at the command line with many options.


To establish a typical connection:

  • At the command prompt, type smbclient \theserver mp psswd where passwd is the password for the current user, and tmp is the resource on theserver.

    Tip

    Table 13.2 lists some of the commonly used smbclient command flags.

    Common smbclient command flags
    FlagComment
    -L hostDisplays a list of resources available on the host
    -I IP AddressCauses smbclient to use the IP address rather than a host name look up
    -NUsed when a password is not required
    -U UsernameUse the specified user name, rather than the Linux logon ID. Passwords are specified using a percent sign. For example, if you were logged on as root, you could issue the following command to connect as juser:
     smbclient \theserver tmp –U juser%passwd
    -W WorkgroupSpecifies the workgroup on the remote SMB server

    Tip

    Once you are connected to a file resource, there are a number of commands available for manipulating files and directories. These are pretty much like the command-line FTP commands (see "Using FTP" earlier in this chapter). Some of the more common commands available for file operations are listed in Table 13.3.

    File Operation Commands
    CommandComment
    cdChanges the directory
    delDeletes a file
    dirLists a directory
    getGets a remote file and saves it on the local system
    lcdChanges the local directory
    mkdirCreates (makes) a directory on the remote resource
    putPuts local files on the remote resource
    quitExits smbclient

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.136.17.12