# Solved: Samba; Windows and Linux wont see each other



## computer_pet

Hi,

I just installed Fedora Core on a Windows XP computer because I want to turn it into a another file sharing and Intranet computer. Did all the install selected server as the setup choice and have started to configure things....

The problem is that my windows computers (including XP's and 2000) can not get into the linux computer in network neighborhood (the windows computers however can see each other and there files). I go to my Workgroup 'HOME' and it displays two windows computers (PHILLIPM2, TWOTHOUSAND) and "Samba Server 3.0.8pre1-0.pre1.3 (Samba)" I double click this but it comes with an error that \\Samba is not accessible

The linux computer can not find the windows computers in the Network folder, it has Windows Network but opening that gives just a blank folder. I can however in terminal find windows shares
(



Code:


smbclient \\\\PHILLIPM2\\GAB - U Family

)
but would prefer being able to access the shares using the Network folder.

On my windows computer I try going to \\192.168.1.20 (IP of linux) but this says it can not be found.

Below is my smb.con file


Code:


[global]
	workgroup = HOME
	server string = Samba Server %v
	security = user
	encrypt passwords = Yes
	smb passwd file = /etc/samba/smbpasswd
	wins support = Yes
	netbios name = Samba

[homes]
	comment = Homes Directories
	read only = Yes
	browseable = No

[family]
	comment = family stuff
	path = /data/mp3
	read only = Yes

And I have my ethernet device (eth0) set to DHCP. I have internet on linux computer and my windows computers can go to http://192.168.1.20 and get the homepage that is stored on the linux computer. So that means the network is working properly. (If needed router is d-link dsl-g640t)

On the linux I made a user "family" (same user/pass as on windows machine) with group "users" login shell "/bin/false" and home directory "/home/family"

As far as I know I think it should be working??


----------



## computer_pet

Any Ideas??


----------



## kbstoikop

force user = root

add it to your share. 
For some reason all samba shares on my fedora systems need this. It doesn't allow access to all it seems to allow the system read write access to the folder.


----------



## tsunam

if that doesn't work, I'll have to take a look at my samba server at home. I'm sure I'll see something. In the interim, can you do a smbclient -L (think its big L might be lower...its the listing) of both windows machines and the linux machine itself and give the printout. I possibly suspect that the reason the samba can't see the windows is because it's getting denied access.


----------



## computer_pet

Okay I tried entering that line but that did not do anything 

smbclient -L results are below, I had to enter a password for the XP and a username + password for the 2000. I could not work out how to get the linux one though.



Code:


============================================================================
PHILLIPM2 - Windows
		Had to enter my password for that computer.
============================================================================

[[email protected] ~]# smbclient -L 192.168.1.15
Password:
Domain=[PHILLIPM2] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]

        Sharename       Type      Comment
        ---------       ----      -------
        phillim25L      Printer   shared
        DocumentsFam    Disk
        CD Drive        Disk
        IPC$            IPC       Remote IPC
        print$          Disk      Printer Drivers
        SharedDocs      Disk
        install1        Disk
        Activision      Disk
        PhillipM (C)    Disk
        Phillip         Disk
        GAB             Disk
        Office          Disk
        PDFConve        Printer   eDoc Printer
        DivX            Disk
        Home Page       Disk
        My Webs         Disk
        HP NEW          Printer   NO - HP LaserJet 5L - NO
session request to 192.168.1.15 failed (Called name not present)
session request to 192 failed (Called name not present)
Domain=[PHILLIPM2] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]

        Server               Comment
        ---------            -------

        Workgroup            Master
        ---------            -------

[[email protected] ~]# smbclient -L PHILLIPM2
Password:
Domain=[PHILLIPM2] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]

        Sharename       Type      Comment
        ---------       ----      -------
        phillim25L      Printer   shared by Peter Modica :)
        DocumentsFam    Disk
        CD Drive        Disk
        IPC$            IPC       Remote IPC
        print$          Disk      Printer Drivers
        SharedDocs      Disk
        install1        Disk
        Activision      Disk
        PhillipM (C)    Disk
        Phillip         Disk
        GAB             Disk
        Office          Disk
        PDFConve        Printer   eDoc Printer
        DivX            Disk
        Home Page       Disk
        My Webs         Disk
        HP NEW          Printer   NO - HP LaserJet 5L - NO
Domain=[PHILLIPM2] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]

        Server               Comment
        ---------            -------

        Workgroup            Master
        ---------            -------
==========================================================================
TWHOTHOUSAND - Windows
		Had to enter a username and password (With both the XP and 2000 the
            username/password is the same.)
==========================================================================

smbclient -L 192.168.1.3
Password:
session setup failed: NT_STATUS_LOGON_FAILURE

[[email protected] ~]# smbclient -L 192.168.1.3 -U Family
Password:
Domain=[TWOTHOUSAND] OS=[Windows 5.0] Server=[Windows 2000 LAN Manager]

        Sharename       Type      Comment
        ---------       ----      -------
        E$              Disk      Default share
        My Documents    Disk
        IPC$            IPC       Remote IPC
        print$          Disk      Printer Drivers
        CanonS40        Printer   Canon S400SP
        PacDoom         Disk
        ADMIN$          Disk      Remote Admin
        C$              Disk      Default share
session request to 192.168.1.3 failed (Called name not present)
session request to 192 failed (Called name not present)
Domain=[TWOTHOUSAND] OS=[Windows 5.0] Server=[Windows 2000 LAN Manager]

        Server               Comment
        ---------            -------

        Workgroup            Master
        ---------            -------


====================================================================
LINUX
	Cannot get into :(
====================================================================
 smbclient -L SERVER
Password:
session setup failed: NT_STATUS_LOGON_FAILURE

[[email protected] ~]# smbclient -L 192.168.1.20
Password:
session setup failed: NT_STATUS_LOGON_FAILURE

[[email protected] ~]# smbclient -L 192.168.1.20 -U peter
Password:
session setup failed: NT_STATUS_LOGON_FAILURE

Does this mean I should make a account on the Windows computers with same username/pass as the linux?


----------



## tsunam

well it does eliminate one thing (you should be able to do smbclient -L localhost). The smbclient can see the shares on the windows machines without problem.

What if any error do you get in windows explorer when you do this

\\192.168.1.20\family <---this should be case sensitive.

one bit of good news, you can mount the windows partitions on the linux server 

Now if you want to mount the windows partitions under linux, you'll want to edit your /etc/fstab and add lines for al lthat you want to mount on the linux box.

[server and sharename]//akiko/share1 [mount location]/media/server smbfs auto,username=[goeshere],password=[goeshere],rw 0 0

just remove the [] stuff and put in the info you need there. username/password are there so that it won't ask on booting etc.


----------



## computer_pet

tsunam said:


> \\192.168.1.20\family <---this should be case sensitive.


"Windows cannot find \\192.168.1.20\family. Check the Spelling and try again, or try searching for the item....."

AND



Code:


[[email protected] ~]# smbclient -L localhost
Password: [no password entered]
Anonymous login successful
Domain=[HOME] OS=[Unix] Server=[Samba 3.0.8pre1-0.pre1.3]

        Sharename       Type      Comment
        ---------       ----      -------
        family          Disk      family stuff
        IPC$            IPC       IPC Service (Samba Server 3.0.8pre1-0.pre1.3)
        ADMIN$          IPC       IPC Service (Samba Server 3.0.8pre1-0.pre1.3)
Anonymous login successful
Domain=[HOME] OS=[Unix] Server=[Samba 3.0.8pre1-0.pre1.3]

        Server               Comment
        ---------            -------
        SAMBA                Samba Server 3.0.8pre1-0.pre1.3

        Workgroup            Master
        ---------            -------
        HOME                 SAMBA

Well thats good I can mount the windows ones, but I really wanted the windows machines access into the linux shares. Is that possible?

Thanks for your help


----------



## tsunam

its possible. I've not done it personally but give me a little bit once i'm home with the ability to play with windows boxes and the linux machines and I should have a answer shortly.

Is the linux machine's workgroup in smb.conf the same as the two other machines workgroups? I don't see it show up in smbclient so that's why i'm asking. For the windows machines to see it..it has to be part of the same workgroup.


----------



## computer_pet

Thanks


----------



## tsunam

if its on the same workgroup, see above edited post. You should be able to ping the linux box by name as well.

If you do have to change the workgroup, you'll need to restart samba.

/etc/init.d/samba restart should do that for you.

Also please note that if you are able to get to the machine via the \\server\share..that it might only allow you to log in as guest. Its one of those oddities of windows.

So to avoid that problem you can map a network drive, that is under the tools option on the top. Select whichever drive letter you want to use. the folder is the same as your \\server\share. It will then prompt you for the username and password. This you can use what you actually will use.


----------



## computer_pet

windows workgroup is HOME which is the same as in smb.com


----------



## tsunam

Leaving work now, and have a few errands to run so I'll check this later on tonight. Hopefully, what i suggested above is the problem.


----------



## computer_pet

tsunam said:


> if its on the same workgroup, see above edited post. You should be able to ping the linux box by name as well.
> 
> If you do have to change the workgroup, you'll need to restart samba.
> 
> /etc/init.d/samba restart should do that for you.
> 
> Also please note that if you are able to get to the machine via the \\server\share..that it might only allow you to log in as guest. Its one of those oddities of windows.
> 
> So to avoid that problem you can map a network drive, that is under the tools option on the top. Select whichever drive letter you want to use. the folder is the same as your \\server\share. It will then prompt you for the username and password. This you can use what you actually will use.


Okay well I know they are on the same workgroup
And I can only ping (from windows) the IP of the linux, I tried Samba and Server but both did not work.

With Mapping network drives;
tried \\192.168.1.20\homes used family as username and my password it just came up with a username/password prompt again 
tried \\server\homes but resulted in network path \\server\homes not found
tried \\samba\homes but resulted in network path \\samba\homes not found

Well I think that means I am able to 'connect' to the linux computer using the IP but can not gain access with the username I am entering.

I even tried adding "guest ok = yes" in smb.conf for the share family and tried the above (with \family) again but this also did not work.

Thanks for your help, hope I can get this working.


----------



## tsunam

alright what does uname -a come up with...Your samba config shoudl be fine as it is. Mine is just slightly different .Shouldn't make a difference, but here is mine:


Code:


[global]
restrict anonymous = 2
log file = /var/log/samba.log
workgroup = tsunam.org
security = user
interfaces = lo eth0
hosts allow = 127.0.0.1 192.168.1.102/24

[share1]
case sensitive = no
path = /media/
public = yes
browseable = yes
create mode = 760
writeable = yes

192.168.1.102 is one of the windows machines that can mount shares. I didn't try it on one of the other machines.

But i can connect to the machine via the name..and i'm wondering if the name is different from what you think or something else is acting up like a firewall.


----------



## computer_pet

Thanks
When I go uname -a I get
Linux SERVER 2.6.9-1.667 #1 Tue Nov 2 14:41 EST 2004 i686 i686 i386 GNU/Linux

I copied your smb.conf file to mine (changed workgroup and set allow 192.168.1.15 (ip of window computer)). Restarted smb, but still can not acess shares from windows, (by going to \\samba or \\sever or \\192.168.1.20)

What could it be? Would I have to enable ports in my router?


----------



## tsunam

internally it won't matter on ports...

With the config you should be able to doe a \\SERVER or ping SERVER and it should ping 192.168.1.20.

I'm running out of idea's of what could be wrong...I'm thinkings its associated with the not seeing the linux box by name..but not super positive =/ going to do some reading to see if i see anything else.


----------



## computer_pet

well i can not ping server or \\server 

This is probably unrelated but I can not connect to mysql from anyother computer (Using phpadmin from a windows machine). As I get a connection refused.
What I am saying is that could I have some how set to refuse connection from other computers?

I can actually see the computer in the network folder just can not get into it (i will attach a picture, from 2000 computer)


----------



## computer_pet

I can actually see the computer in the network folder just can not get into it (i will attach a picture, from 2000 computer)[/QUOTE]


----------



## tsunam

are you running iptables on the linux machine Iptables = firewall for linux. That could be saying to not allow the connections. 

The not being able to ping it by name seems to be what i'm concentrating on...you can see the server but not connect.

Does anything show up in /var/log/samba for connection errors?


----------



## computer_pet

I went to Apps > Secuirty Level and Disabled Firewall and
the windows machines can now get into the shares!!! 

I cant believe it was that simple! I think I went through the smb.conf file over 100 times lol.

Thanks for your help tsunam! Would probably never of worked that out.


----------



## computer_pet

Well just a thought that disabling firewall would not be that good I have enabled it but put ticks next to HTPP, FTP, SMTP and eth0 (eth0 was not ticked before) and this still alows the windows computers access.

Thanks again


----------



## tsunam

Glad we got it worked. Samba if i remember uses ports 137-139 default. Just glad we got it working for you and sorry for it taking as long as it did.


----------



## computer_pet

Well it would be my fault for taking so long  I am just so happy we got it working


----------



## rmmt

Excellent; followed this link and now I could browse the computer "jacko" and see the folders that I shared.. however, it asks for a username and password (I type in the ones I put in the "Users" in Samba configuration) but it doesn't allow me through!

Is it as simple as editing the Samba Users or do I have to edit a text file somewhere?

Thanks


----------

