Cheap VPS & Xen Server


Residential Proxy Network - Hourly & Monthly Packages

Browsing the Windows network with your linux machine with automatic mounting and discovery of all hosts and shares.


Index

  • 1. Introduction and Summary

Introduction

For some time I’ve been looking for a good way to let my computer discover the Windows network and mount shares on demand. There isn’t a good enough solution for at this moment. After trying the kioslaves in the desktop of my choice (KDE) and the FUSE programs Fusesmb and SmbNetFs, I was not really satisfied. There had to be an way to let my computer discover all the workgroups/domains, the hosts and the shares, and mount a share on a hosts on demand. Some will say: mount the shares of your choice by hand, and off you go. But no!! This is not what I want. I can let my computer discover automatically discover all the hosts and shares available, and mount the share only when needed. This should be possible! And after trying I’ve found out it is!

The following issues are necessary imho:

  • automatic discovery of the SMB network (domains, hosts and shares)
  • building of a representation which makes sense to the users logged in their homedirectory
  • automatic mounting of shares on demand
  • automatic unmounting of shares after some time unused
  • use of a kernel fs like SMBFS or CIFS
  • independent of a Desktop Manager
  • support of other networkservices like SSH and FTP

 

The FUSE program Fusesmb comes very near to what I’m looking for, but lacks the extended capabilities CIFS has, like the right presentation of the permissions, support of inotify, symlink and ATTR/ACL. It took me some time to find out why the FUSE program lacks these features. FuseSMB is based upon the smbclient library smbclient.so, which is part of the Samba package, and has nothing to do with smbfs or cifs.

The result

The result of this construction is a networkrelated directory (Global Network) in your homedirectory, where the automounter provides a browseable tree to access all the supported networkservices.

At this moment it supports the services SMB and SSH (I’m working on FTP). Accessing the “network mountpoint”:

/home/sbon/Global Network/
SSH hosts
Windows Network

Accessing the Windows Network (==smb), all the workgroups and/or domains appear:

/home/sbon/Global Network/
SSH hosts
Windows Network
BONONLINE
CWWERKGROEP

Entering the workgroup CWWERKGROEP, all the servers and other hosts do show up:

/home/sbon/Global Network/
SSH hosts
Windows Network
BONONLINE
CWWERKGROEP
ROUTER
PC1

Entering the server ROUTER, the shares available to the connecting user appear:

/home/sbon/Global Network/
SSH hosts
Windows Network
BONONLINE
CWWERKGROEP
ROUTER
cwdocumenten
public
sbon

Accessing a share, it’s automatically mounted (with CIFS or SMBFS). The use of credentials is supported, guest logins are the default.

To build the “multi mount map” for the smb service, a networkcache is used. It provides information about workgroups and/or domains. hosts and server and shares available. It is maintained by some scripts, which make use of some utilities (nbtscan to determine the hosts and workgroups/domains and smbclient to determine the shares per host).

Accessing the SSH hosts (=ssh), all the hosts where this user has access to appear:

 

Comments

comments