LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   windows cannot read linux's shared folder (https://www.linuxquestions.org/questions/linux-software-2/windows-cannot-read-linuxs-shared-folder-577316/)

gymnart 08-15-2007 12:53 PM

windows cannot read linux's shared folder
 
On my home network, when I first set things up, my windows computer was able to "see" my Linux computer and read the publicly shared folder.

Now it cannot read it at all. When I click on the directory from Windows, it tells me that it is not accessible and does not have permission.

I checked the folder in question on the Linux computer and the "Shared" tab is all *greyed* out and the "Not Shared" has been selected. How do I change this so that the Windows computer can read that public folder again?

I did have KDE 3.4.2 but now I have KDE 3.5.6 on SuSE 10.0.

tjyorkshire 08-15-2007 01:19 PM

You using samba right?

What does the samba config file look like?

If you want a share to be publicly accessible by all computer on the network, it needs to look something like this:

smb.conf:
Code:

[global]
        workgroup = <workgroup name>
        printing = cups
        printcap name = cups
        printcap cache time = 750
        cups options = raw
        map to guest = Bad User
        include = /etc/samba/dhcp.conf
        logon path = \\%L\profiles\.msprofile
        logon home = \\%L\%U\.9xprofile
        logon drive = P:
        usershare allow guests = Yes
        add machine script = /usr/sbin/useradd  -c Machine -d /var/lib/nobody -s /bin/false %m$
        domain logons = No
        domain master = No
        netbios name = <computer name>
        security = share
        guest account = nobody

[<share name>]
        comment =
        path = <path to folder>
        browseable = yes
        read only = no
        guest ok = yes
        create mask = 0777
        directory mask = 0777


gymnart 08-15-2007 01:37 PM

Mine looks different:
Code:

[global]
        workgroup = <workgroup>
        printcap name = cups
        cups options = raw
        map to guest = Bad User
        include = /etc/samba/dhcp.conf
        logon path = \\%L\profiles\.msprofile
        logon home = \\%L\%U\.9xprofile
        logon drive = P:
        add machine script = /usr/sbin/useradd  -c Machine -d /var/lib/nobody -s /bin/false %m$
        domain master = No
        winbind gid = 10000-20000
        winbind uid = 10000-20000
        passdb backend = <passwd>
        restrict anonymous = no
        max protocol = NT
        ldap ssl = No
        server signing = Auto
        guest ok = yes
        domain logons = No
        idmap gid = 10000-20000
        idmap uid = 10000-20000
        security = user

## Share disabled by YaST
# [homes]
#        comment = Home Directories
#        valid users = %S
#        browseable = No
#        read only = No
#        inherit acls = Yes

## Share disabled by YaST
# [profiles]
#        comment = Network Profiles Service
#        path = /var/tmp
#        create mask = 0600
#        directory mask = 0700
#        case sensitive = no
#        msdfs proxy = no

[users]
        comment = All users
        path = /home/
        inherit acls = yes
        veto files = /aquota.user/groups/shares/
        write list = <username>
        case sensitive = no
        msdfs proxy = no

[print$]
        comment = Printer Drivers
        path = /var/lib/samba/drivers
        write list = @ntadmin,root
        force group = ntadmin
        create mask = 0664
        directory mask = 0775
        case sensitive = no
        msdfs proxy = no

[printers]
        printable = yes
        printer name = Epson
        use client driver = yes
        path = /printers

[<public folder>]
        path = /home/<username>/<public folder>

## Share disabled by YaST
# [netlogon]

I want the Windows machines to be able to read and copy from but not move from or write to the shared folder.

I'm using YaST to edit the Samba config file.

tjyorkshire 08-15-2007 02:01 PM

Something like this then:

Code:

[global]
        workgroup = <workgroup>
        printcap name = cups
        cups options = raw
        map to guest = Bad User
        include = /etc/samba/dhcp.conf
        logon path = \\%L\profiles\.msprofile
        logon home = \\%L\%U\.9xprofile
        logon drive = P:
        add machine script = /usr/sbin/useradd  -c Machine -d /var/lib/nobody -s /bin/false %m$
        domain master = No
        winbind gid = 10000-20000
        winbind uid = 10000-20000
        passdb backend = <passwd>
        restrict anonymous = no
        max protocol = NT
        ldap ssl = No
        server signing = Auto
        guest ok = yes
        domain logons = No
        idmap gid = 10000-20000
        idmap uid = 10000-20000
        security = user
        guest account = nobody

## Share disabled by YaST
# [homes]
#        comment = Home Directories
#        valid users = %S
#        browseable = No
#        read only = No
#        inherit acls = Yes

## Share disabled by YaST
# [profiles]
#        comment = Network Profiles Service
#        path = /var/tmp
#        create mask = 0600
#        directory mask = 0700
#        case sensitive = no
#        msdfs proxy = no

[users]
        comment = All users
        path = /home/
        inherit acls = yes
        veto files = /aquota.user/groups/shares/
        write list = <username>
        case sensitive = no
        msdfs proxy = no

[print$]
        comment = Printer Drivers
        path = /var/lib/samba/drivers
        write list = @ntadmin,root
        force group = ntadmin
        create mask = 0664
        directory mask = 0775
        case sensitive = no
        msdfs proxy = no

[printers]
        printable = yes
        printer name = Epson
        use client driver = yes
        path = /printers

[<public folder>]
        path = /home/<username>/<public folder>
        browseable = yes
        read only = yes
        guest ok = yes



## Share disabled by YaST
# [netlogon]


gymnart 08-15-2007 02:13 PM

I edited it using a text editor and before I did that, I copied smb.conf to a backup (smb.conf.old) and then added what you said. I did not know how to issue a command for Samba to restart (I guessed that it might be necessary) so I rebooted the computer.

Unfortunately, Windows XP still cannot read the shared public folder. When I view the folder's properties in Konquerer, the Shared part is still greyed out.

nightshade_1977 08-16-2007 08:46 AM

if your trying to make it so that anyone on your network can access this share make the following change
change
Quote:

security = user
to
Quote:

security = share
if you only want certain users to be able to access the share then you need to add samba users

tjyorkshire 08-16-2007 08:48 AM

oh yes, and "security = share", i seem to overlooked that :)

gymnart 08-16-2007 01:10 PM

I just tried that and Windows still can't find my Linux computer. I still get that "the computer is unavailable" and "you don't have permission to access this computer" messages.

I'm beginning to wonder if this is not due to some security update somewhere?

Like I said, the Linux computer does not show up on the home network when viewing from the Windows XP computer but Samba has no problem with viewing and transferring files from the Windows computer to the Linux computer.

I still don't understand why when viewing the Public folder in Konquerer, the contents of the "Share" tab are greyed out and, like I said, the public folder is checked off as "Not Shared".

tjyorkshire 08-16-2007 01:15 PM

What are the permissions on the public folder itself?

gymnart 08-16-2007 01:30 PM

Owner: Can View & Modify Content
Group: Can View
Others: Can view

Ownership: <me>
Group: Users

drwxr-xr-x

tjyorkshire 08-16-2007 01:39 PM

I have also just noticed you don't have "netbios name = <computer name>" in your config file - Thats probably why windows can't see linux.

gymnart 08-16-2007 01:56 PM

Which computer's name should I put in for the netbios? Linux or the Windows? Anything else?

tjyorkshire 08-16-2007 02:02 PM

Anything you like - but its the name that will be seen by clients connecting to your samba server (so basically whatever name you want to call linux in the network)

gymnart 08-16-2007 02:14 PM

Do I have to restart Samba or anything to see the changes take effect? If so, how do I do that?

tjyorkshire 08-16-2007 02:32 PM

Samba should re-check the config file every minute, but to do it manually :

Code:

/etc/init.d/smb restart


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