SuSE Linux: Versions since 8.1
smbclient -L netbios-namenetbios-name stands for the NetBIOS name of the Windows machine. If the access attempt fails, an authentication process with the user name is required. In this case, the syntax of the command reads:
smbclient -L netbios-name -U user_nameThe output is a list displaying the shares:
earth:~ # smbclient -L winmachine -U testuser added interface ip=192.168.0.1 bcast=192.168.0.255 nmask=255.255.255.0 Password: Anonymous login successful Domain=[WORKGROUP] OS=[Windows 5.0] Server=[Windows 2000 LAN Manager] Sharename Type Comment --------- ---- ------- IPC$ IPC Remote-IPC testshare Disk test-share ADMIN$ Disk Remoteadmin C$ Disk Standard share Server Comment --------- ------- WINMACHINE Workgroup Master --------- ------- WORKGROUP WINMACHINEAccording to the list, the folder testshare from the computer winmachine is shared. To mount it with the command mount, a mount point must be created:
mkdir -p /windows/winshareNow mount the Windows share on your file system by means of the following command (replace the computer and folder name with those of your system):
mount -t smbfs //winmachine/testshare /windows/winshareThis command mounts the share testshare of the Windows computer winmachine. The data can be now accessed in the directory /windows/winshare.
If the Windows computer requires an authentication process with the user name, the command's syntax reads:
mount -t smbfs -o username=user,password=secret //winmachine/testshare /windows/winshareReplace user with the user name needed for the authentication on the Windows machine and secret with the password.
For the folder to be automatically mounted at every system start, insert a corresponding option in the file /etc/fstab (written in a single line):
//winmachine/testshare /windows/winshare smbfs auto,gid=users,fmask=0664,dmask=0775,iocharset=iso8859-15 0 0The example contains additional options like gid=users, which means that not only root but also common Linux users are allowed to access the Windows share data, or fmask and dmask, which define the permissions with which files or directories will be shown in the local system. iocharset=iso8859-15 determines the character set. View additional options with man smbmount.
Since all the users in the Linux system have read permissions for the file /etc/fstab, the options username and password should not be directly entered here. Instead, use the option credentials=/path/file_name, which enables you to create a file only readable for root in which to store user names and passwords.
The respective line in the file /etc/fstab may look like this (again, everything in a single line):
//winmachine/testshare /windows/winshare smbfs auto,gid=users,umask=0002,iocharset=iso8859-15,credentials=/etc/winpassword 0 0Then create the password file /etc/winpassword with the content
username = user password = secretand assign it root-only read and write permissions with the command
chmod 600 /etc/winpassword
First, make sure that the packages kdenetwork3-lisa, kdenetwork3-lan, kdebase3-samba, samba-client, and (if needed) samba are installed. If not, install them with YaST2.
To setup LISa, start the KDE Control Center and select the following menu items to launch LISa's configuration wizard:
The package samba must be installed to use the method "Send NetBIOS Broadcasts", because the program nmblookup will be used. Only machines with Windows shares will be found. For additional information, refer to the help texts.
If you have selected the first method, the address range "pinged" by LISa will be defined in the next input field. Enter the network's IP address and netmask. For example, in the case of a private class C network this would be 192.168.0.0/255.255.255.0. You can usually adopt a proposal that is already given. In case of doubt, view the IP and netmask with the shell command:
/sbin/ifconfigIf the LISa service should only be accessed from the Linux computer, enter this machine's IP address and netmask in the input field "Trusted hosts". The IP address of the Linux machine must also be entered in "Own broadcast network address". As for the update interval, simply take the default value 300 sec. The options included in the dialog "Expert settings" are only required if LISa does not find all the computers on the network. Close the configuration.
To save these settings in the file /etc/lisarc on a permanent basis, press the Apply button in the Control Center (lower left corner), enter the root password, and press OK. Now the KDE Control Center can be closed. Then start LISa by entering the following command in a root shell:
rclisa startFor this service to be started automatically during the next boot process, also execute the command
insserv lisa
To access the Windows shares, open KDE's file manager Konqueror and enter lan:/ in the URL field. Those computers providing network services are then listed. Display these services by clicking the host name (smb stands for a Windows share). Then you have access to the resources in that computer.
Further information about LISa is available at http://lisa-home.sourceforge.net.
smb://netbios-nameAlternatively, reinstall the package kdenetwork3-lan from the CD/DVD.
Note: Mounting Windows shares exceeds the scope of the free-of-charge installation support. The Advanced Support Service is available, however. More information about this service is available under http://www.suse.de/en/services/support/private/advanced.html.