Online Book Reader

Home Category

Running Linux, 5th Edition - Matthias Kalle Dalheimer [296]

By Root 1102 0
2005

My Pictures DR 0 Tue Sep 30 18:36:17 2003

My Videos DR 0 Thu Aug 5 23:37:56 2004

38146 blocks of size 1048576. 31522 blocks available

smb: \>

We can change directory into the CanoScanCSUv571a directory:

smb: \> cd CanoScanCSUv571a

smb: \CanoScanCSUv571a\>

But we want to see what files are in there:

smb: \CanoScanCSUv571a\> dir

. D 0 Thu May 19 12:06:01 2005

.. D 0 Thu May 19 12:06:01 2005

CanoScanCSUv571a.exe A 3398144 Thu Mar 13 22:40:40 2003

Deldrv1205.exe A 77824 Fri Apr 26 14:51:02 2002

N122U.cat A 13644 Tue May 21 02:44:30 2002

N122u.inf A 6151 Tue Apr 16 22:07:00 2002

N122UNT.cat A 15311 Tue May 21 02:44:32 2002

N122USG D 0 Thu May 19 12:10:40 2005

USBSCAN.SYS A 8944 Fri Jun 12 13:01:02 1998

38146 blocks of size 1048576. 31522 blocks available

smb: \CanoScanCSUv571a\>

Good. Everything so far is working. Let's download a file. Fetching and uploading files with smbclient works just like an FTP client:

smb: \CanoScanCSUv571a\ >get Deldrv1205.exe

getting file \CanoScanCSUv571a\Deldrv1205.exe of size 77824

as Deldrv1205.exe (275.4 kb/s) (average 275.4 kb/s)

It all worked as it should. We are done with this demonstration. Let's quit back to a shell prompt:

smb: \CanoScanCSUv571a\> quit

linux:~ #

Let's summarize what has been learned so far. We have confirmed the following about our environment:

There is TCP/IP connectivity between the Linux and Windows systems.

Anonymous browsing is disabled on the Windows XP Home system.

Authenticated browsing using a local Windows account and password works.

smbclient was designed to be highly versatile. It is used as part of the smbprint utility, where it pipes the print data stream through to a remote SMB/CIFS print queue in a manner analogous to the file transfer example witnessed earlier. For more information regarding the smbclient utility, refer to the manpage.

One you have basic SMB/CIFS interoperability, it should not be too difficult to mount the same share using smbfs. Let's move on and try that in the next section.

Using Linux-kernel-based smbfs

Before proceeding, let's look at what the smbfs filesystem driver does. This tool has some limitations that few people stop to recognize.

The smbfs filesystem driver behaves like the smbclient utility. It makes an authenticated connection to the target SMB/CIFS server using the credentials of a user, based on the account name and password provided. The filesystem driver then permits the SMB/CIFS connection to be attached to a Linux filesystem mount point. The Linux ownership of the mount point will reflect the user ID and group ID of the Linux user who mounts it, and the permissions will be determined by the UMASK in effect at the time of mounting.

In effect, access to all files and directories will be subject to Linux filesystem permission controls, and on the SMB/CIFS server everything will take place as a single user. Multiple concurrent Linux users who access the file share through the mount point will be making multiple concurrent accesses as a single Windows user, and will do so using a single Windows process.

There is one other, rather significant design limitation when using the smbfs filesystem driver. It does not support Unicode , and therefore creates problems when files contain characters other than the English alphabet. It should also be mentioned that this kernel module is somewhat defective and is no longer maintained. So why use it? That is easy to answer. Some Linux systems do not have support for cifsfs.

With these caveats stated and in the open, let's mount that SMB/CIFS filesystem:

linux:~ # mount -t smbfs //emacho/shareddocs /mnt \

-ousername=lct,password=2bblue4u,uid=jim,gid=users

linux:~ #

That was easy! It is time to test whether it works.

linux:~ # cd /

linux:~ # ls -ald /mnt

drwxr-xr-x 1 jim users 4096 May 20 02:50 mnt

This demonstrates that the connection is mounted as the local Unix user jim. Let's copy some files to, and from, this system:

linux:~ # cd /mnt

linux:~ # ls -al

total 25

drwxr-xr-x 1 lct users 4096 May 20 02:50

Return Main Page Previous Page Next Page

®Online Book Reader