If you have the relevant version of the samba client, there's "nmblookup" which should allow you to add "wins" as an option for hostname lookups in the file /etc/nsswitch.conf (which determines how various information is gathered) if the windows machine is in the same subnet, e.g.
You can lookup names from the commandline of your *nix box:
Code: Select all
$ nmblookup lap-win2k
querying lap-win2k on 192.168.0.255
192.168.0.251 lap-win2k<00>
There are options for nmblookup if you have a WINS server on another subnet which you want to query, so long as it is aware of them.
It should be possible to list the shares on a windows or samba server with 'smbclient':
Code: Select all
$ smbclient -L \\lap-win2k
password:
Domain=[FORBURY] OS=[Windows 5.0] Server=[Windows 2000 LAN Manager]
Sharename Type Comment
--------- ---- -------
IPC$ IPC Remote IPC
games Disk
ADMIN$ Disk Remote Admin
C$ Disk Default share
etc.
Not all *nixes have an smbmount command, but mount.cifs seems to be there where smbmount isn't on two linux boxen I have. You might only have smbclient, which is a bit more of a pain to use.
Code: Select all
ubuntu-pc $ sudo smbmount \\\\192.168.0.251\\c$ /mnt/c/ -o username=administrator
suse-pc $ sudo mount -t cifs \\\\192.168.0.251\\games /mnt/c -o user=dominic
in a bash script I use this under IRIX or Linux to get the contents of \\servername\attachments\$1, although it messes up if the directory doesn't exist:
Code: Select all
smbclient \\\\servername\\attachments -W myworkgrp -c 'cd '$1'; prom ;dir ; mget *'
Samba has its own database of passwords (see man smbpasswd) and its shares, printers etc. are defined in smb.conf (usually in /etc/samba), but I find it a lot easier to export a directory from a linux server via NFS and Samba than to get smbclient or smbmount to work from a linux box, mainly due to the syntaxes above.
ok, I'll shush now. corrections welcome.
OMG (or oligodendrocyte myelin glycoprotein) is a molecule found in your central nervous system.