LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   samba share access denied error (https://www.linuxquestions.org/questions/linux-server-73/samba-share-access-denied-error-4175430188/)

PlorkZ 10-02-2012 09:57 PM

samba share access denied error
 
I'm setting up a new server system, CentOS 5.8, to do web hosting among other things. I also have a system running currently as my production server, I believe this is CentOS 5.3. I'm trying to set up the new system to match the configuration of the current one, but I'm running into a problem with Samba shares. I have user accounts on the new server that I want to have full access to web sites (/var/www/virtualhosts/), and the way I did this on the current production system was to put those users in a group called webadmin and give that group access to the virtualhosts directory and all sub directories, then with those users' hoe directories set up as samba shares, I create a link to the virtualhosts directory and put that link those users' home directories, i.e. /home/webuser1/virtualhosts/. That worked fine before, but on the new system I'm getting an error when I try to open that virtualhosts folder from within my home share (I'm accessing my home share on each server from a windows xp comp on the network). The error is "\\servername\webuser1\virtualhosts is not accessible. You might not have permission to use this network resource. Contact the administrator to find out if you have access permissions. Access is denied".

Here is my home share in smb.conf:
Code:

[homes]
        comment = Home Directories
        path = /home/%u
        browseable = no
        writable = yes

Other pertinent samba settings are as follows:
Code:

        interfaces = lo eth0 192.168.7.0/24
        hosts allow = 127. 192.168.7.
        security = user
        passdb backend = tdbsam
        username map = /etc/samba/smbusers

These are the same as my current production server, all other settings are default/correct for my network. I tried switching between security = share and security = user, but same error either way. I should also note that the home shares themselves seem to work fine, i.e. I can browse to \\server\webuser1\ and create/edit files there, just not the virtualhosts link. Any help is greatly appreciated!

markie83 10-02-2012 11:30 PM

first thing I have found using usernames with samba stinks (I always use the IP) if you insist on using hostnames be sure its defined in your smb.conf and that your nmb service is running.

also I am always bad about forgetting to run #smbpasswd -a username

also I always make my shares look like this

[sharename]
path = /home/user/share
browseable = yes
comment = share
writable = yes
public = yes
guest ok = yes


and the standard tip about your firewall allowing smb & nmb connections etc

PlorkZ 10-04-2012 06:25 PM

Thanks for the tips, I ran smbpasswd -a for the usernames. I don't want to open up the users' home directories to everyone, so I'm not going to set the public and guest ok options on the home shares. on my current production system I created symlinks within the user home directories and was able to access the directories behind those links, I'd like to be able to do the same on the new system. As an alternative I can set up samba shares directly to the different locations I want to give users access to, i.e. /var/www/virtualhosts could be set up as:

Code:

[virtualhosts]
        comment = Virtual Web
        path = /var/www/virtualhosts
        writeable = yes
        valid users = ...

But if possible I'd like to keep everything contained within the user' home directories so they don't have a bunch of different network shares to sort through.

jettwa2001 10-06-2012 01:33 PM

Do you have Selinux enable? if so check the samba man page you need to change the security type context

PlorkZ 10-07-2012 10:54 PM

No, SELinux is disabled (not permissive mode, completely disabled during OS installation).

deep27ak 10-08-2012 12:52 AM

Here follow this blog for Creating Samba Share


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