[Leaplist] green machine (XO) and LAN name resolution
Fuzzy Conner
fuznacious at yahoo.com
Wed Dec 19 19:42:07 GMT 2007
<snip>
>> My problem is that I have to resort to using the static IP in the mount call to mount a CIFS store to my new fedora boxen.
<snip>
>> This is not a request to solve a problem, I've got (almost) everything working that I need to.
>> If anyone remembers a link that lead to an "AH HA" moment re name resolution (smbfs/CIFS/nfs) please pass it on.
I have an answer, and please forgive me for going into what might be too many details:
Assuming you're wanting the mount to not depend on having a user doing this with, say, Konqueror...
You're probably wanting "nmblookup" which is a NetBIOS over TCP/IP client used to look up NetBIOS names.
If you've got SaMBa installed you probably have it:
[fuzzy at laptop ~]$ which nmblookup
/usr/bin/nmblookup
Typical example of nmblookup:
[fuzzy at laptop ~]$ nmblookup machine_name
querying machine_name on 192.168.1.255
192.168.1.101 machine_name<00>
...and now, the too many details part about how I've used it with mount.cifs (which, if you have SaMBa installed you probably also have)...
Getting only the IP address from nmblookup output:
[fuzzy at laptop ~]$ nmblookup machine_name |grep 00 |cut -d " " -f 1
192.168.1.101
I've done this before:
[root at laptop ~]$ /sbin/mount.cifs \\\\`nmblookup machine_name |grep 00 |cut -d " " -f 1`\\share_name /local/machine/path/to/mount/point -ocredentials=/some/local/file/only/root/can/read
After which you can verify:
[fuzzy at laptop ~]$ df -h
//192.168.1.101/share_name 34G 22G 64% /local/machine/path/to/mount/point
Only root can run mount.cifs per the mount.cifs man page.
You can use a credentials file so you won't have to have user(s) passwords visible in any shell history (see mount.cifs man page for its format).
As root will be doing the mounting, "chown root:root" that credentials file and "chmod 400" that credentials file.
The man page for mount.cifs gives much more information than this--my example is just one thing I've done with it.
HTH,
--Fuzzy
____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.leap-cf.org/pipermail/leaplist/attachments/20071219/b5b4bd7e/attachment.html
More information about the Leaplist
mailing list