smbsh

The smbsh program is part of the Samba suite and works on some, but not all, Unix variants.[28] Effectively, it adds a wrapper around the user’s command shell, enabling it and common Unix utilities to work on files and directories in SMB shares, in addition to files and directories in the local Unix filesystem. From the user’s perspective, the effect is that of a simulated mount of the SMB shares onto the Unix filesystem.

smbsh works by running the shell and programs run from it in an environment in which calls to the standard C library are redirected to the smbwrapper library, which has support for operating on SMB shares. This redirection can work only if the program being run is dynamically linked. Fortunately, modern Unix versions ship with most common utilities linked dynamically rather than statically.

Tip

To determine whether a program is dynamically or statically linked, try using the file command.

To use smbsh, your Samba installation must be configured using the configure option --with-smbwrapper.

If you have a number of Unix systems with the same host operating system and architecture and don’t want to bother with a full Samba installation, you can simply move the following files to the other systems:

/usr/local/samba/bin/smbsh
/usr/local/samba/bin/smbwrapper.so
/usr/local/samba/lib/smb.conf

Make sure that /usr/local/samba/bin is in your shell’s search path. The smb.conf file is needed only for smbsh to determine the workgroup or domain and does not need to be as ...

Get Using Samba, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.