LinNeighborhood
Readme:
LinNeighborhood - Linux port of the Windows Network Neighborhood

This Software is distributed under the GNU General Public License - see the accompanying COPYING file for more details.

You can reach the authors at:
Hans Schmid (schmidjo@bnro.de)
Richard Stemmer (rstemmer@innternet.de)

You can get the latest version at official LinNeighborhood web site:
http://www.bnro.de/~schmidjo/

Description

Requirements

Running LinNeighborhood

Command Line Parameters
Configuration
Scan Page

Workgroup
Master browser
Always scan as user
Groups scan as user
Group scan as user
Ask user / password once
Use group name on mount
Initial browse on startup
Quick browse

Programs Page

smbclient
nmblookup
smbmount
smbumount
smbmount version

Miscellaneous Page

Use 'RootMountDir/machine/share' as default mount point
Root mount dir
Show log window
Sorted Share Lists
Memorize Mounted Shares / Remount on next startup

Post Mount Page

Run File Manager after Mounting

Browsing
Mounting Shares
Adding Favorite Hosts
Options/Import lmhosts file
Options/Export Mountscript
Options/Remove all favorite hosts


Description:

LinNeighborhood is a Xwindow graphical port of Network Neighborhood, running over Samba utilities and the Linux smbfs programs under kernels 2.0.

It permits to browse an SMB (CIFS) network consisting of Samba, Windows (WfWg, 95, 98, NT) and probably (not tested) OS/2, LanManager for DOS and others. It also offers an interface to mount the found shares.

Because the smb-filesystem and smbmount utility is only available on Linux this is a Linux only program.

Requirements:

See the install-file for the software needed to compile LinNeighborhood.

For running it you need:

Installed Samba package, expecially smbclient and nmblookup utility. Samba is available at http://samba.org/samba. Use a recent version of Samba, we tested with 1.9.18 and 2.0.5a. Expecially look for supported name resolve order option, bedause resolving is mostly done by broadcasts and this must be supported if you need it in your network.

Kernel < 2.1.70: Smbfs-package smbfs-2.0.x.tgz with smbmount and smbumount utilities from ftp://ftp.gwdg.de/pub/linux/misc/smbfs.

Kernel > 2.1.70: You must use the smbmount/smbmnt/smbumount from from the Samba package.

Support for the changed command syntax (kernel 2.0 - kernel 2.2) is included in LinNeighborhood at runtime, using the uname function call. This means you can use a program that was compiled with 2.0 kernel on a 2.2. machine and vice versa (if your libraries are the same), but of course the correct smbmount/umount must be installed. The command line syntax has changed from samba 2.0.4 to 2.0.5, you must configure this in the preferences. smbfs-2.0.x.tgz does not compile on glibc based Linux (problems with include files), but there are patched version available, e.g. RedHat's smbfs-2.0.1-4.src.rpm package.

Support for SMB filesystem must be compiled into your kernel to use smbmount, please read the smbfs-documentation in your kernel tree to see if you should use CONFIG_SMB_WIN95.

The above stuff is included in most Linux distributions, so you normally should have all the programs.


Running LinNeighborhood:

Command Line Parameters:

LinNeighborhood has the following command line parameters built in:

-h {--help} prints out the command line parameters

-m {--mountshares} mounts the memorized shares without starting the GUI

-v {--version} prints out the program version

-i {--iconify} start program iconified (minimized)

Configuration:

When running the program the first time, open the "Options/Preferences" menu. Enter the following information in the scan page:

- Workgroup

This is the group of your preferred master browser, not necessarily your workgroup. This setting is mandatory.

- Master browser

If you know a fixed master browser in your network you can enter it here. LinNeighborhood will try to retrieve the workgroup list from this machine. This will only work if it is premanently on and has a high os level (see smb.conf.5), so it is probable that a NT or Samba server will allways be a master browser among Windows 95/98 machines if set accordingliy. This also means that windows 9x machines should only run one protocol (TCP/IP), otherwise it is more likely that they become a master browser, see BROWSING-Config.txt. You can always set a Samba server (this could be your machine with running Samba) as your master browser, because it always offers a small group list where it shows the master for its group. LinNeighborhood evaluates this and asks the real master browser for the group list in a second pass. Check the box to make this setting active. If you have a WINS server, you can also use it as a master browser, but enter its name and not the IP-address, and also its group and it must be configured in smb.conf.

Normally you will only have to enter the workgroup, and no master browser. But there is a bug in WfWg, Win95 (with winsock version 1, and NT 3.5 that makes it impossible for normal users to get the name of the master browser (node status query). You can upgrade Win95 to Winsock 2 in order not to have this problems, look for ws2setup.exe at microsoft.com. See UNIX-SMB.txt and nmblookup.1 (only in Samba-2.0.x) from Samba documentation for more details. Then it could be necessary to use a configured master browser. It is also a good idea to enter a workgroup where you know that none of the buggy windows machines could ever be the master browser. We admit that this situation is not quite satisfying if you have many of these buggy machines in your network and none of the above solutions works for you. Then the only solution we see is to change the nbmlookup call in smbbrowse.c so that it binds to udp port 137 (-r option). But then root privileges are needed to run the program and nmbd must not run, this is mostly unacceptable. A smarter approach would be to have a root privileged lookup deamon, queried by nmblookup, which can bind to this port and is integrated in nmbd, but doing this is not within the scope of this work, only the Samba maintainers can manage it (this is an item form the Samba wishlist).

- Always scan as user

If the box is checked you will be prompted for user/password information when you browse a host, and hosts are always browsed with user/password. See the browsing section ("scan as user") to decide if you need it.

- Groups scan as user

User/password information will also be used for the groups browse (on startup). This is only necessary, if your first master browser (that gives you the groups list) has no guest account, what was only observed at certein OS/2 servers.

- Group scan as user

Same as mentioned above is valid for the group browse if this box is checked.

- Ask user / password once

You will be prompted only once for user/password information if this box is checked an "Always scan as user" is activated. If you want to change user/password do a "scan as user".

- Use group name on mount

If you set this option, the smbmount command uses the -D (for 2.0 kernels) or -W option on mounting because this is sometimes necessary. You can turn it off, because older 2.0 kernels/smbfs packages break when it is on.

- Initial browse on startup

If this is checked LinNeighborhood will immediately do a groups browse after startup. You may want to disable this if there are many groups in your network and you only want to access your favorite hosts, you don't have a browsing delay then.

- Quick browse

Normally, when you scan for groups only the groups are shown, information about the hosts in the groups is only available when you do a group scan. If you check here, all groups are immediately scanned, and you see the available hosts by clicking the '+'-sign.

The Programs page:

- smbclient

Enter the location of the smbclient program, full path is required if it is not in your PATH. Note that this program retrieves configuration information from the smb.conf file, see the documentation to set it up correctly. Important options are "name resolve order", "wins server", "interfaces". Make smb.conf readable to users.

- nmblookup

Same as with smbclient. There is a bug in nmblookup (at least in 1.9.18 and 2.0.3) which disables the correct behavior when "debug level" or "log level" in smb.conf is set to "0", so set it to "1" (or higher) or leave the option away until this is fixed by the Samba people, the command line option -d1 is useless. (Fixed in >= 2.0.4!)

- smbmount

Enter the location of the smbmount program, with full path if necessary. This program should be setuid root (smbmnt with kernels >= 2.1.70), so that every user can mount shares, it should be safe to do so. If you use smbmount from the samba package, SMBFS_DEBUG must not be defined (around line 45 in smbmount.c), otherwise it does not close the stdout pipe back to LinNeighborhood process, which LinNeighborhood depends on. This will cause strange behavior, because the program will get the mount callback when unmounting is done. (Also recommended for programs like automount.). The smbmnt program (called by smbmount) must always be in your path, it is not found in the same directory where smbmount is.

- smbumount

Same as with smbmount, also setuid root recommended.

- smbmount Version

Select your smbmount version here, if you are using a >=2.1.70 Kernel. This is needed, because the command line syntax has changed dependant on the version. We do not recommend to use Version 2.0.5, because it is less stable than the previous one and has less mount options, but 2.0.6 seems to work fine again. Hope this list will not grow any more in the future.

The Miscellaneous page:

- Use 'RootMountDir/machine/share' as default mount point

If this box is checked there will be a suggestion for the mount point in the style 'RootMountDir/machine/share' for the mount point in the mount dialog.

- Root mount dir

When opening the mount dialog this directory will be the base directory for the mount point. Normally you will create a subdirectory from here for each single share.

- Show log window

LinNeighborhood can show you all command lines and the corresponding outputs in a log window, when it calls the above utilities. If you want this, check the box. Passwords are hidden with '*'.

- Sorted Share Lists

All displayed share lists are alphabetically sorted, shares before printers, if the box is checked, otherwise they come as smbclient puts them out.

- Memorize Mounted Shares / Remount on next startup

If you want LinNeighborhood to memorize the shares you mounted in this session in order to remount them on next startup, check this option. LinNeighborhood inserts all successful mounts in an internal database, it also will remove them from this database when unmounting. This database is stored in the ~/linneighborhoodrc file on program termination. Be careful, any smb password you typed in during mount process will be stored in this file in an unencrypted manner (file permission 0600). If you don't want this, deactivate this feature. For security issues, any mount actions performed as root aren't stored in this file. That also means that you cannot use this feature with this kind of mount action.

Command Parameter -m --mountshares:

It's possible to start LinNeighborhood in order to remount all shares stored in ~/linneighborhoodrc without starting the GUI, e.g. on system startup. Type 'LinNeighborhood -m' to do so. This function is internally done by storing the actual command line parameters of smbmount in the configured version. If you change your version to an incompatible one (e.g. upgrade from kernel 2.0 to 2.2), the old memorized mounts will not work any more and are thrown out.

The Post Mount page:

- Run File Manager after Mounting

It's possible to start a file manager after a successful mount action. Activate this checkbox to do so. There are some predefined command syntaxes for commonly used file managers in the combo box. Select yours and press the arrow button to move it into the edit field. The "$MOUNTPOINT" macro of the command syntax will be replaced with the directory you mounted the share. Indeed it's possible to run any command you type into the edit field. For example, if you want to start your own file manager called 'MyFileManager' and this file manager does accept an option like '-f /any/directory' to start on a certain directory, insert the following into the edit field:

'MyFileManager -f $MOUNTPOINT'

If you have a file manager not predefined in the combobox, feel free to send us the command syntax and we'll pick it up into the next release of the software.


Browsing

When you start the program and everything is set up correctly it begins with a "group browse" and you see the groups in the network. This is internally done by searching a master browser with nmblookup if none is configured (see preferences), following a call of smbclient to get the workgroup list with groups and master browsers. You can repeat this by using the "rescan groups" popup menu.

When groups are visible double click groups or use the "rescan group" menu to see the hosts in the group. LinNeighborhood gets this information from the master browser determined by the "groups browse". It is possible that you don't get information here, because the master browser has changed or shut down meanwhile. Then do a "rescan groups" again and hope the correct master browser for the group is available now. There is a shortcut built in that shows you at least the master browser when it gets an empty browse list, then you get a "(master without browse list)" comment. Note that you may not find all groups and hosts compared to a Windows machine. One reason is that Windows has another browsing strategy, it does not trust in master browser's browse lists, it finds the group members with broadcasts and so can compensate the unreliability of windows master browsers. But because of the windows port 137 bug we had not very much success in doing this and didn't implement it. Another common reason for not findng hosts is the use of another protocol like NetBEUI, Samba can of course only access to hosts running NetBIOS over TCP/IP.

Double click the host or do "rescan machine" to see what shares are available. This is normally done with the -U% option of smbclient, which uses the guest account of a server. But some shares are only shown to the owner, e.g. the home directory of a Samba user. It the server is in user level security a password is necessary, too. Then you must use "sacn as user". Be careful when browsing fails and you have entered a user/password pair, check the information for correctness before you retry because sometimes the server is configured to lock you out when you try a wrong password too often.

The right popup menu 'show information' can show you some interesting information about computers, which is available after browsing, i.e. Name, Domain, OS, Server, IP-Address. This data is output by smbclient, note that Windows 3.x and 9x machines don't show Domain, OS and Server.

You can stop all browsing actions if something hangs (hosts do not respond) by pressing the stop button in the toolbar.

Mounting shares

When you find the desired share you can mount it. You can only mount file shares; printers are not supported by this application - you must set up your printing system accordingly or print a single file with smbclient. You will get the mount dialog if you right click "mount". The smbmount options are reflected in this dialog, see smbmount.8 for details. Samba 2.0.5 smbmount does not support UID, GID, File Mode, Dir Mode options, so you cannot use these options. Note that the file mode field in mount dialog is 4 digits long to enable Win95 mount options at runtime (with 2.2 kernel, see linux/Documentation/filesystems/smbfs.txt). The mount point can be easily selected and created in a file select dialog. You can also create a mount point with root permissions if you had checked "mount as root" before you have pressed the file select button. If you have checked "Use 'RootMountDir/machine/share' as default mount point" there is a suggestion for a mount point according to the server/share name and the "Root mount dir". This mount point will be created if it does not exist, with root permissions if "mount as root" is used. There is only one user/password pair cached in the application for all "scan as user" and "mount" operations, please note this. As normal user you can only mount to a directory that you own. You can mount to any directory if you mount as root, then check the box and enter the password. The root password is never cached. Smbmount from the smbfs package does not support encrypted passwords (this is a restriction of SMB file system dirver in 2.0.x kernels). So you can only mount shares if your server allows clear text passwords (most servers do, but it may be disabled, ask your admin). If you set up Samba with encrypted passwords and this is different from your normal user password you may be confused, because newer smbclient versions support encrypted passwords for browsing and the clear text password for mounting.

You can unmount shares accordingly, you will be prompted for the root password if you are not the owner. The mount point directory will not be deleted, you have to do this manually. Remember, if there is any process (e.g. file manager) accessing to the mounted directory, you cannot unmount it because of being busy.

The stop button in the toolbar stops pending mount actions, too.

Adding Favorite Hosts

If, for any reason, a host is not found by browsing or you don't want to search for it you can still connect to it. Use "add favorite host" to add it to the browse list. This is done without checking if it is accessible. You can also enter a group name, if you omit it no group is given as argument to smbmount, but this does not always work. Some servers give shares only to group members what you fake when you enter a group (this is M$ security). You can browse hosts and mount shares in the same way as with the machines found by browsing. If you don't know the group or only have an IP-address instead of of the name use the 'Query' button. This will do a node status query, but as mentioned earlier this does not always work with some M$ machines (port 137 problem). If there are netbios aliases you will only get the first name here, perhaps you will have to change it if the server has different behavior dependant on the name. There is a point "edit machine" in the popup menu which allows you to edit the information of already entered hosts, you can try a bit here if browse problems encounter. Only name or IP-address are mandatory, but all information gives you the best chance to access problematical hosts.

All manually added hosts (and some other information like window sizes and memorized shares) are stored automatically on program termination in the file .linneighborhoodrc, which is located in your home directory. Configuration data is also stored in this file, but only on request, see configuration part.

Options/Import lmhosts file

This will add all hosts in your lmhosts file to the favorite hosts list.

Options/Export Mountscript

This exports a file containing the command lines to mount all memorized shares that are presently mounted (Option memorize mounted shares must be active for this to work). You can use it in own scripts, but note that smb passwords are included here in clear text.

Options/Remove all favorite hosts

This removes all computers from the favorite hosts list.

Don't forget to press the Save Button after configuring LinNeighborhood.