LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Cant connect to samba share from windows (https://www.linuxquestions.org/questions/linux-newbie-8/cant-connect-to-samba-share-from-windows-867564/)

linux hates me 03-09-2011 04:57 PM

Cant connect to samba share from windows
 
Ok I am setting up samba on my CentOS server for the first time. I am using webmin to configure samba.

Here is the smb.conf

Code:

[global]
        netbios name = KISKA
        cups options = raw
        load printers = yes
        server string =
        default = global
        workgroup = NUS
        os level = 20
        null passwords = yes
        username map = /etc/samba/user.map
        encrypt passwords = yes
        security = user
        passdb backend = tdbsam


[Web]
        guest account = Staff
        delete readonly = yes
        writeable = yes
        path = /var/www/nusalaska/html
        force group = Tech
        revalidate = yes
        force user = Tech
        valid users = Admin,Staff,Tech,@Admin,@Tech,@staff
        public = yes
        create mode = 777
        directory mode = 777

I can see the domain name "KISKA" in the "network" tab of windows explorer, however when I click on it I get this error:

Windows cannot access \\KISKA
check the spelling of the name. otherwise there might be a problem with your network.

Under the details of this error I get this:
"The network path was not found"

Also I have stopped iptables so it cant be firewalled

corp769 03-09-2011 05:18 PM

Is kiska the actual host name of your linux box? Try accessing your box using its IP address instead of the host name to see if that's the problem.

linux hates me 03-09-2011 05:45 PM

Quote:

Originally Posted by corp769 (Post 4284809)
Is kiska the actual host name of your linux box? Try accessing your box using its IP address instead of the host name to see if that's the problem.

Ok

1) I tried mapping a network drive using both the domain name "Kiska" and the ip address with no luck
2) I can ping the box using the ip address (used above) and I get a good response
3) How do I change the Actual host name? Is that not a part of Samba?

alan99 03-09-2011 06:19 PM

your server string is empty. Try something like "server string = %h" that should should assign your hostname to the Netbios name that is broadcasts. Also try adding hosts allow = 127.,192.168.1. (substituting your correct LAN subnet for 192.168.1. ) to the global section. Also the "remote announce = 192.168.1.255 (or the proper broadcast address for you subnet) will tell it were to broadcast it's presence so the client can 'see' it.

linux hates me 03-09-2011 06:44 PM

Quote:

Originally Posted by alan99 (Post 4284848)
Also try adding hosts allow = 127.,192.168.1. (substituting your correct LAN subnet for 192.168.1. )

I dont exactly understand what you wrote here, there seems to be a period then a comma after 127. Is that comma supposed to be there?? was the 127 supposed to be after the 192.168.? what you wrote just doesnt seem logical.

Also, I added %h to the server string and Now I can connect by mapping a hard drive, however it rejects any username and password I enter. I have tried both usernames and passwords from my windows computer and the Usernames and passwords set in samba (they are identical and are kept updated by the unix usernames and passwords) and It wont let me access the share using any of them.

thanks for your help so far!

linux hates me 03-09-2011 09:35 PM

anyone??

liquidhorse 03-16-2012 03:21 PM

smbpasswd
 
Not sure if it still matters, but I've noticed in my experiences that even if the samba passwords are kept in sync with unix, you still often have to "smbpasswd -a" your user before samba will acknowledge. Just my experience...might be some configuration settings I never change from the defaults!

evilputty 03-16-2012 03:23 PM

Quote:

Originally Posted by linux hates me (Post 4284855)
I dont exactly understand what you wrote here, there seems to be a period then a comma after 127. Is that comma supposed to be there?? was the 127 supposed to be after the 192.168.? what you wrote just doesnt seem logical.

Also, I added %h to the server string and Now I can connect by mapping a hard drive, however it rejects any username and password I enter. I have tried both usernames and passwords from my windows computer and the Usernames and passwords set in samba (they are identical and are kept updated by the unix usernames and passwords) and It wont let me access the share using any of them.

thanks for your help so far!

indicates a range within the ip

suicidaleggroll 03-16-2012 03:34 PM

Here's my smb.conf, for what it's worth. This machine has been happily running Samba for about a year, with two Win7 machines accessing it on a daily basis, never a failure, never needed to reconfigure.

Machine is running OpenSUSE 11.4

Code:

# Samba config file created using SWAT
# from UNKNOWN (127.0.0.1)
# Date: 2011/05/03 15:44:53

[global]
        map to guest = Bad User
        name resolve order = bcast host lmhosts
        printcap name = cups
        add machine script = /usr/sbin/useradd  -c Machine -d /var/lib/nobody -s  /bin/false %m$
        logon path = \\%L\profiles\.msprofile
        logon drive = P:
        logon home = \\%L\%U\.9xprofile
        domain master = No
        hosts allow = 192.168.101.
        cups options = raw
        netbios name = craig
        wins support = No
        workgroup = WORKGROUP
        usershare max shares = 100


[raid]
        comment = raid
        path = /home/raid
        read only = No
        guest ok = Yes
        inherit acls = Yes


T3RM1NVT0R 03-16-2012 03:47 PM

@ Reply
 
Hi linux hates me,

Did you check selinux status on CentOS machine. By default selinux is set to run in targeted mode. If it is set to targeted then check Samba booleans using the following command:

Code:

getsebool -a | egrep '(smb)|(nmb)|(wins)|(samba)'
The machine from which you are trying to access is Windows XP or Windows 7?


All times are GMT -5. The time now is 01:46 AM.