I am trying to have accessible computer by its network name (same as hostname) by ping and Samba client from other computers and one directory shared on my laptop.
I simple, trivial wish I hope. Nothing extravagant. Something what every Windows user has out-of-the box, just to select a shared directory.
However I struggle hard to do the same with linux.
Sharing directory with samba is relatively easy, the issues I have is with my laptop network name. It is not recognized/propagated to the local network.
I cannot rely on static data in /etc/hosts. This is a laptop not a server, I move it between different networks.
To achieve propagation of my network name (hostname) dynamically, so everyone in the local network can at least ping me, I was advised to use winbind (winbindd), that is to rely on MS NetBios technology There is no native linux technology to achieve this? shame! what about plain/dynamic DNS? why it is not my network name not propagated to my local DNS server/wifi/rooter?
Anyway.
To do that I was advised to do:
- run winbind service (winbindd daemon)
- run samba service (umm, not sure if this is necessary for network name propagation, but I also want to share data so lets keep it as an essential).
- add “wins” to /etc/nsswitch.conf to “hosts” section
Well, it seems to work on my other two computers with Ubuntu and Mandriva well. But not on Suse
Well, not completely, not permanently.
It magically start working when I call “Yast -> Samba Configuration”.
No change here (everything is already set: Domain Name, Not a DC, Netbios Hostname, Wins server support=yes, use Wins for Hostname Resolution) just hit OK.
It runs SOMETHING in the background (some scripts) for a few seconds.
And then abrakadabra, everything is fine, my network name is recognized, everyone can use my samba exposed directory, smb4k sees me in the Network Neighborhood.
BUT when I restart, I am “back in square one”.
Pinging my name does not work, smb4k does not see me, or cannot find me even by IP! Samba sharing works by using direct IP. Not all clients support connecting by IP notably not smb4k. To use Samba properly you have to sort out network name visibility fist.
I would like to make “Yast -> Samba Configuration” achievements somewhat more PERMANENT.
What exactly runs when I hit OK?
No new server/daemon was started. I checked PS, nothing with newer PID appeared. And samba and winbind are started on boot, they were running indeed.
No change in configuration was made. I checked all changes made in /etc - but none found!
Where is winbind configuration? smb.conf?
Do I need to run wins server/client, another daemon?
Any hint?
Many thanks for any help!
Espinosa
More details:
espinosa@espinosadell:~> hostname
espinosadell
espinosa@espinosadell:~> cat /etc/samba/smb.conf
Samba config file created using SWAT
from UNKNOWN (127.0.0.1)
Date: 2011/06/19 15:45:43
[global]
workgroup = HOMENET
passdb backend = smbpasswd
wide links = Yes
follow symlinks = yes
unix extensions = no
netbios name = espinosadell
wins support = Yes
[public]
comment = public
path = /home/espinosa/public
read only = No
/etc/nsswitch.conf (shortened):
hosts: files dns wins
networks: files dns
services: files
(old values for hosts were: files mdns4_minimal [NOTFOUND=return] dns, what is the mdns4_minimal [NOTFOUND=return]??? I rather removed it)
espinosa@espinosadell:~> cat /etc/HOSTNAME
espinosadell
(I removed domain name, all other computers have just one name, hostname, …and they work)
espinosa@espinosadell:~> cat /etc/hosts
127.0.0.1 localhost
special IPv6 addresses
::1 localhost ipv6-localhost ipv6-loopback
fe00::0 ipv6-localnet
ff00::0 ipv6-mcastprefix
ff02::1 ipv6-allnodes
ff02::2 ipv6-allrouters
ff02::3 ipv6-allhosts
(I removed “espinosadell” from the localhost line. To test ping to my machine locally, to test that that it takes “espinosadell” from network not “hosts” file)
espinosa@espinosadell:~> rpm -qa | grep -i samba
samba-client-3.5.4-5.9.1.i586
yast2-samba-server-2.18.3-3.2.noarch
yast2-samba-client-2.19.6-1.4.noarch
samba-3.5.4-5.9.1.i586
samba-winbind-3.5.4-5.9.1.i586
espinosa@espinosadell:~> rpm -qa | grep -i winbind
samba-winbind-3.5.4-5.9.1.i586