Browsing a Windows Network in GNU/Linux

2004-08-14 11:46:37

Just because you are running Linux doesn't mean you don't have access to resources on networks built on Windows technology. Linux is well known for its adaptability as a server, but it is no second class citizen on the client side. In fact, the sharing technology we'll cover here can be convinient to share data within an all Linux environment, too.

Samba ??? the sharing backbone

Samba is a GPL'ed suite that implements SMB, the Server Message Block protocol that form the basis of Windows file and print sharing. More recent revisions of SMB are refered to as CIFS, the Common Internet File System. Samba is a large product known mostly for its ability to turn Unix-like systems into Windows compatible file servers. Just describing it adequately can easily fill an entre book, but for our purposes here, we only need to consider the client side tools in the samba-client package, which are included with virtually every Linux distribution. These tools enable the smbfs mounting, the process of connecting a remote Share so that it functions as part of your local file system.

LinNeighborhood

LinNeighborhood is a browser for SMB networks. It's system requirements are modest, and it can work with several generations of Samba and Linux. Check your distro's packages first, or pick up the source tarball from the homepage. Once installed, configuring consists of clicking the Prefs button and picking a file manager to launch. You can also optionally specify a workgroup, WINS servers and other parameters you can glean from the Windows boxes you wish to browse. LinNeighborhood will present a view of all the workgroups it encountered in its scan. Double clicking a workgroup will show the shared resources. Right clicking will bring up a context menu that allows mounting, unmounting, rescan and similar options. Mounting is most easily done to a directory within your own user home, and LinNeighborhood will manage sub-directories matching the machine and share names of the mounts.

Alternatives

Some say Linux is all about choice, and LAN browsing is no exception to that rule. If you are using a recent version of KDE, check out Smb4K, which offers comparable functionality, but tightly dependent on KDE. Also, both Konqueror and Nautilus offer smb:/ URI's to browse SMB networks, although the results are sometimes less than optimal. And last, but not least, the command line tools, such as smbclient, smbtree and smbmount offer the down to the bottom power and flexibility.

Security and Troubleshooting

Mounting in Unix-like systems is a privilege usually reserved for the super user, root. To make it possible for regular user accounts to mount shares, there has to be a way to temporarily gain root access. This is usually accomplished by setting a special permission flag on the executable programs that perform the actual mounts and unmounts. This flag is known as the SETUID bit, since it SETs the UserID for authority to the program file's owner. Be warned! From a security standpoint, this is a very dangerous way to solve the problem. In this case, however, special safeguards have been built in to the Samba client programs and libraries to minimize the risks. This does mean that you will have to be especially careful to keep the package up to date with any security patches. If you have followed the advice about using your distribution's versions of the packages, the packagers have probably already taken care of setting the permissions, and they will publish security errata whenever new problems are discovered. If you have decided to, or have to, do things by hand, you may need to execute a command chmod +s for both smbmnt and smbumount.

Good luck with your browsing!

Article 23 was last updated 2004-08-14 12:06:02

Have the need to access resources on Windows network? No problem! This installment of Kickin' Apps introduces some Linux tools for the job.