Setting Up and Using a Samba Client

If you are working on a Linux desktop computer in a mixed networked environment where Windows systems are in use, you are very likely to want to be able to access shares on those Windows systems. If you only run a Samba client, you will not be able to share resources on the Linux machine so that they show up as shares that can be used on Windows. To do that you need to set up a Samba server.

Let's look at the command-line options for mounting an SMB/CIFS share.

If a Windows machine on the network is called boojumwin and is offering a share called photos, you can mount the share with the following command:

# mount -t cifs //boojumwin/photos /mint -o username=roger Password:

This example used the Windows notation of \\SERVER\share, but with the difference that backslashes are replaced by forward slashes. The share is mounted locally on /mint. This assumes that a user called roger exists on the Windows machine and has the right to view this share.

boojumwin is the name known to DNS for the Windows server. If there is a difference between the DNS names and the names that Windows knows, it may be necessary to add an option similar to -o ip= in the mount command.

Older SUSE versions provide an smbmount command, which is normally accessed as mount -t smbfs. The equivalent command to the previous example is:

# mount -t smbfs //boojumwin/photos /mint -o username=roger

The command smbclient allows us to see the shares that are being made available by a particular host, as shown here:

# smbclient -L boojumwin -U roger Password:

Domain=[BOOJUMWIN] OS=[Windows 5.0] Server=[Windows 2000 LAN Manager] Sharename Type Comment photos Disk


prints Disk Printer Drivers

ADMINS Disk Remote Admin

CS Disk Default share

Domain=[BOOJUMWIN] OS=[Windows 5.0] Server=[Windows 2000 LAN Manager]

Server Comment

Workgroup Master

Here you see the shares available on BOOJUMWI

The command smbtree tries to browse the network for Windows shares and provides text output as follows:

# smbtree Password: WORKGROUP



\\FLAMINGO\ \\FLAMINGO\ 3.0.26a-3-1478-SUSE-SL10.3)

Samba 3.0.26a-3-1478-SUSE-SL10.3 aserjet4 HP LaserJet 4L







vl\ADMIN$ \| \printS AIPCS Aphotos

IPC Service (Samba

Printer Drivers All groups All users

Network Profiles Service

Default share Remote Admin Printer Drivers Remote IPC

Here you see two servers on the network that are offering shares: the first, FLAMINGO, is a Samba server running on openSUSE. BOOJUMWIN is a genuine Windows machine.

Both KDE and GNOME's file managers have the ability to browse for shares on the network, as shown in Figures 18-1 and 18-2.

Was this article helpful?

0 0

Post a comment