E-Mail:

Samba Client

  • No Related Post

Samba Client

We’ve talked about setting up Samba to share files and printers from a Linux server to a Windows client. SWAT is an outstanding tool for configuring your Samba server. But once you’ve set up the server, how can you be sure it’s doing what it’s supposed to be doing?

smbclient is a built-in tool for accessing remote servers to browse, to store or retrieve files, or to print. As a command line tool, it’s extremely flexible and lightweight. It can be used to connect to other Samba servers or to Windows NT/2000 servers.

To connect to a remote server using smbclient, issue the following command:

    smbclient -L hostname

You’ll be returned a message noting that the ip address, broadcast address and netmask have been added. You’ll also be returned a password prompt. If the server allows browsing, a password will not be required. Simply press [enter] and you’ll be on the server. If the server is configured to prevent browsing, you’ll need to enter the password assigned you for the server.

A more elegant way to access the remote server is with the following command:

    smbclient //server/sharename

This will connect you directly to the share on the remote server, though you may still be required to enter a password. Once you’re connected, you’ll be able to put files on the server with put or mput (batch putting files) and retrieve with get or mget (batch getting files).

As I’ve already mentioned, you can use smbclient to print to remote printers, as well. If the remote printer is attached to a Windows NT/2000 machine, the server only needs to be configured to share the printer with other Windows machines via SMB. To make the connection to the remote printer, enter the following command:

    smbclient //server/lp -p

You’re now connected to the SMB share as a printer. Issue the command to print a document as:

    print doctoprint.txt

You can see how Samba can make the networked environment, whether at home or on the job, a much easier place to navigate. Samba and smbclient make it possible for two very different OSs to share files and printers seamlessly.

What Do You Think?

 
53 queries / 0.130 seconds.