LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-21-2008, 01:14 PM   #1
jianght
LQ Newbie
 
Registered: Feb 2008
Posts: 16

Rep: Reputation: 0
samba does not work


Hi,
I installed samba on centos4 for AMD Opteron machine. I checked
service smb status:
smbd (pid 22145 22141) is running...
nmbd (pid 22147 22146) is running...
But when I tried to connect it from window side by
\\192.168.0.100
it says:
the network path was not found
But I can ping that machine and ssh to that machine.

Another strange things is that I don't see /etc/samba/smbpasswd

Your help is greatly appreciated!
Best,
Alfred
 
Old 03-21-2008, 03:49 PM   #2
rajeshkerala
Member
 
Registered: Mar 2008
Posts: 35

Rep: Reputation: 15
hope u had done this..
vi /etc/samba/smb.conf

[global]
workgroup=<workgroup name of the windows computer>
 
Old 03-21-2008, 05:22 PM   #3
jianght
LQ Newbie
 
Registered: Feb 2008
Posts: 16

Original Poster
Rep: Reputation: 0
Hi,
I just use MYGROUP.
BTW, somehow, when I use smbpasswd, I don't see anything changes in smbusers file. Besides, I cannot find smbpasswd file.
Best,
Alfred
 
Old 03-21-2008, 06:49 PM   #4
Jayla
Member
 
Registered: Nov 2005
Location: Suffolk, UK
Distribution: kubuntu 9.04
Posts: 188

Rep: Reputation: 30
Hi Alfred

I have recently setup samba myself, I followed the guide linked below and it worked a charm with no issues!

http://ubuntuforums.org/showthread.php?t=103328

Hope this helps
 
Old 03-22-2008, 01:51 AM   #5
jianght
LQ Newbie
 
Registered: Feb 2008
Posts: 16

Original Poster
Rep: Reputation: 0
Hi,
Thanks. What is netbios name? Is it machine's ip address or just hostname?
Best,
Alfred
 
Old 03-22-2008, 02:03 AM   #6
townie
Member
 
Registered: Oct 2007
Distribution: Ubuntu 8.10 beta and Debian etch
Posts: 75

Rep: Reputation: 15
hi
the netbios name is not hte ip address or the hostname is similar to the hostname there a link below to wikipedia that cna explain the diffenrcehttp://en.wikipedia.org/wiki/NetBIOS_name#Name_service

 
Old 03-22-2008, 04:02 AM   #7
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
The "smbpasswd" file should be in /etc/samba/. If it isn't there, did you run
smbpasswd -a <username>
password

The samba package supplies the html version of the "Using Samba 2nd Edition" book. Look in /usr/share/samba/.
Either the samba package or a samba-doc package supplies a number of manpages, sample configurations and the books: Samba 3 by Example & Samba 3 HOWTO and Reference. These books will take you step by step on various types of configurations including what ownership & permissions to use on certain types of shares. For example for a world writable share, use the same permissions that are used for the /tmp directory:
sudo mkdir /srv/samba/public
sudo chmod a=rwxt /srv/samba/public

---

Your problem of the service or the host not showing up in the Network Neighborhood browser could be due the ports 137 and 445 being blocked at either the server or the client. Some older windows clients use ports 137-139.

Also consider using "wins support = yes" on the server, and then enter your server's IP address in the WINS entry of your DHCP NAT router if you have on. This will reduce the broadcast traffic on your network and network browsing may function better. Don't use this option if you already use a WINS server. You can only have one Samba WINS server per subnet.

---

Using samba swat can also simplify setting up a samba server. see "man 8 swat".
First you need to enable it in the /etc/xinet.d/swat configuration file. Change the line "disable = yes" to "disable = no".
Then make sure that xinet.d is running: "sudo /sbin/chkconfig swat on"
Restart the xinetd service: "sudo killall xinetd"
Then in your web browser, browse to "http://localhost:901"

Last edited by jschiwal; 03-22-2008 at 07:47 AM. Reason: typo
 
Old 03-22-2008, 09:52 PM   #8
jianght
LQ Newbie
 
Registered: Feb 2008
Posts: 16

Original Poster
Rep: Reputation: 0
Hi,
Thanks a lot. I tried those tricks but it did not work.
Here are some extra facts:
1) hostname : tt0.uuart.com
2) lmhosts: 127.0.0.1 localhost
3) the local IP address for that machine is 192.168.0.100
4) in smb.conf
I have not specified netbios name. I am wondering what it should be.
5) [root@tt0 samba]# nmblookup -B chelsea _SAMBA_
querying _SAMBA_ on 127.0.0.1
name_query failed to find name _SAMBA_

In my case, it is just local network. the I don't have DNS server and tt0.uuart.com is just a name I put when set up the machine.
Before, when it is localhost.localdomain. It works.
Thanks a lot,
Best,
Alfred
 
Old 03-22-2008, 10:14 PM   #9
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
Enter in the "hostname" command. It should respond with the hostname portion (without the domain name part). I think it will be tt0. The domainname command on the other hand will return the NIS domain name and not the FQDN domain portion. Might as well use the same name for your netbios hostname. If your /etc/nsswitch.conf file contains an entry for either wins, winbind or if your NAT router is used as a DNS address and /etc/nsswitch.conf contains a "dns" entry in the "hosts:" line, then I think they must be the same. So while you mentioned that you don't run a DNS server, some NAT routers do provide a local DNS server and hosts that use DHCP will have the router address used as one of the three DNS entries in /etc/resolv.conf. I think this would mandate having the hostname be the same for the netbios name and the hostname part of your FQDN that you used in /etc/hosts.

You were correct in changing "localhost.localdomain". Another host trying to reach you by that name would reach itself instead. I think the point of having that at the start is so that you don't have several hosts on the network with default names that are real hostnames.

I use "hpamd64.jesnet" in /etc/hosts for my laptop and "hpmedia.jesnet" in /etc/hosts for my desktop. They also have alias entries in /etc/hosts hpamd64 & hpmedia respectively. I also have an entry in /etc/network for jesnet.

Code:
 getent hosts hpamd64
127.0.0.2       hpamd64.jesnet hpamd64
jschiwal@hpamd64:~> getent hosts hpmedia
192.168.1.105   hpmedia.jesnet hpmedia
jschiwal@hpamd64:~> getent networks jesnet
jesnet                192.168.1.0
From /etc/hosts on hpamd64:
Code:
192.168.1.105   hpmedia.jesnet hpmedia
I didn't use a .net or .com because I don't have a fixed internet address. If I did I probably wouln't be able to just make up a network name. The network name shows up in things like the output of the "route" command which makes it more readable.

Last edited by jschiwal; 03-22-2008 at 10:40 PM.
 
Old 03-23-2008, 10:15 PM   #10
jianght
LQ Newbie
 
Registered: Feb 2008
Posts: 16

Original Poster
Rep: Reputation: 0
Hi,
Thanks for so much on those information. One question, when I tried to access from window side, I always use ip address: 192.168.0.100. In this case, why do I need netbios name?
Besides, I checked nsswitch.conf file:
passwd: files
shadow: files
group: files
Should I change it as somebody mentioned through google search?
passwd: files wins
shadow: files wins
group: files wins
From what you said, it looks like I have to modify my machine's name.I tried to change it back to localhost.localdomain. It does not work anymore for samba. I used to use centos5 and now I am using centos4. I should have written all those info down.
Best,
Alfred
 
Old 03-23-2008, 10:27 PM   #11
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Did you try without SELinux running?

setenforce 0

and setenforce 1 to turn it back on
 
Old 03-23-2008, 10:55 PM   #12
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
Don't change it back to localhost.localdomain. That is just wrong. What did "hostname" return. Might as well use that. Fedora Core has the hostname set in /etc/sysconfig/network. "HOSTNAME = <yourhostname>". The part before the dot (.) is used as the hostname. Your original hostname (tt0.uuart.com) has a hostname part (tt0) and a domain name part (uuart.com). Where did the uuart.com come from? If you just made it up, maybe drop the .com because "uuart.com" isn't an internet domain. ( As I stated before, uuart.com isn't the "domainname" because "domainname" returns the NIS domain, and since you aren't using NIS you don't have one.)

I have FC6 on an old (Pentium III) dell laptop. Here are my /etc/sysconfig/network's HOSTNAME & /etc/networks files:
Code:
HOSTNAME = delllap.jesnet
 
jschiwal@lmac:~> cat /etc/networks
#
# networks      This file describes a number of netname-to-address
#               mappings for the TCP/IP subsystem.  It is mostly
#               used at boot time, when no name servers are running.
#

loopback        127.0.0.0
link-local      169.254.0.0
jesnet          192.168.1.0

For entries in /etc/nss_switch there will be a cooresponding library file needed. For example if you have a dns entry make sure there is a libnss_dns library installed. It will probably be from a package by the same name.

Code:
/lib/libnss_compat-2.6.1.so
/lib/libnss_compat.so.2
/lib/libnss_dns-2.6.1.so
/lib/libnss_dns.so.2
/lib/libnss_files-2.6.1.so
/lib/libnss_files.so.2
/lib/libnss_hesiod-2.6.1.so
/lib/libnss_hesiod.so.2
/lib/libnss_ldap.so.2
/lib/libnss_mdns.so.2
/lib/libnss_mdns4.so.2
/lib/libnss_mdns4_minimal.so.2
/lib/libnss_mdns6.so.2
/lib/libnss_mdns6_minimal.so.2
/lib/libnss_mdns_minimal.so.2
/lib/libnss_nis-2.6.1.so
/lib/libnss_nis.so.2
/lib/libnss_nisplus-2.6.1.so
/lib/libnss_nisplus.so.2
/lib/libnss_winbind.so.2
/lib/libnss_wins.so.2
If you have an "avahi" (zero config) daemon running, then install the "libnss_mdns4_minimal" and "libnss_dns" libraries and use:
Code:
hosts:          files mdns4_minimal [NOTFOUND=return] dns
This may have more to do with having hosts show up in Linux however.

The "libnss_winbind" corresponds with a winbind entry in nsswitch.conf and libnss_wins with a wins entry.

If you used "wins support = Yes" in your smb.conf, make sure that both the smbd and nmbd daemons are running. If you have users in windows who aren't Linux users, running the winbind daemon may help aleviate the need to map bad users to guest for public shares.

Also use nmap or another port scanner on another computer and determine if ports 139 & 445 are open.

Also run the "firewall & security" config. There is a tab for selinux. Look under samba and see what it says. Billymayday's tip is to disable selinux completely temporarily as a troubleshooting technique. I think you need to reboot after using the "setenforce" command.

Also look in the "Samba 3 HOWTO & Reference" document. I think there is a troubleshooting section that deals with browsing.

Another thing to consider is to set up samba using swat.
A) edit /etc/xinet.d/swat. Edit the "disable = yes" line to "disable = no" line.
B) if xinetd is running, restart it with "sudo killall xinetd"
C) if xinetd is not running start it with "sudo /sbin/service xinetd start" or "sudo /sbin/chkconfig xinetd on"
D) Point your web browser to "http://localhost:901"

The html version of the books I mentioned will be available on the bottom of the intro page.


Also make sure that none of the windows clients have an unused protocol installed such as IPX support. This will cause that host to always be elected as the master browser. If that host has a problem then browsing might not work well.

You might as well post your /etc/samba/smb.conf file. Maybe someone will notice something there.

Start with giving this host a normal hostname and rebooting. Then see if browsing on the Windows hosts starts working.

Last edited by jschiwal; 03-24-2008 at 12:32 AM.
 
Old 03-24-2008, 01:24 AM   #13
jianght
LQ Newbie
 
Registered: Feb 2008
Posts: 16

Original Poster
Rep: Reputation: 0
Hi,
Thanks again. I tried SElinux option, it is the same. Then I tried to reset IP address from 192.168.0.100 to 192.168.0.110 and restarted my samba. Then I found this issue:
smbclient -L tt0
Error connecting to 192.168.0.100 (No route to host)
Connection to tt0 failed
Why is it still 192.168.0.100?
I can ssh to this machine through 192.168.0.110. I think this might be reason. Because I reset this machine to centos4. I setup samba using 192.168.0.100 with centos5 for a while for this machine. I think it is confused for some reason.
Now the question is how I can make sure smbclient to choose the new IP or local host?

Best,
Alfred
 
Old 03-24-2008, 02:58 AM   #14
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
If you changed your IP address, then edit any /etc/hosts files to reflect the change.
 
Old 03-24-2008, 01:04 PM   #15
jianght
LQ Newbie
 
Registered: Feb 2008
Posts: 16

Original Poster
Rep: Reputation: 0
Hi,
my /etc/hosts has only one line
127.0.0.1 tt0 localhost.localdomain localhost
Should I remove tt0?
But I don't understand how smbclient decides to use 192.168.0.100?
Best,
Alfred
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
need help getting samba to work dvdljns Linux - Networking 12 05-21-2005 10:13 PM
Samba and XP: HAS ANYONE EVER GOTTEN IT TO WORK? AlexiaDeath Linux - Networking 7 10-12-2004 01:23 PM
How to work Samba? treotan Linux - Newbie 3 09-03-2004 11:50 PM
Win->Samba works, Samba->Win does'nt work outburst Linux - Networking 2 10-30-2003 09:31 AM
Help I cant Get Samba to Work sdiprose2002 Mandriva 1 10-16-2003 12:57 PM


All times are GMT -5. The time now is 01:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration