Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 10-02-2012, 10:57 PM   #1
Registered: Aug 2004
Posts: 32

Rep: Reputation: 15
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:
        comment = Home Directories
        path = /home/%u
        browseable = no
        writable = yes
Other pertinent samba settings are as follows:
        interfaces = lo eth0
        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!
Old 10-03-2012, 12:30 AM   #2
LQ Newbie
Registered: Dec 2009
Posts: 25

Rep: Reputation: 0
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

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
Old 10-04-2012, 07:25 PM   #3
Registered: Aug 2004
Posts: 32

Original Poster
Rep: Reputation: 15
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:

        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.
Old 10-06-2012, 02:33 PM   #4
Registered: Dec 2007
Posts: 38

Rep: Reputation: 15
Do you have Selinux enable? if so check the samba man page you need to change the security type context
Old 10-07-2012, 11:54 PM   #5
Registered: Aug 2004
Posts: 32

Original Poster
Rep: Reputation: 15
No, SELinux is disabled (not permissive mode, completely disabled during OS installation).
Old 10-08-2012, 01:52 AM   #6
Senior Member
Registered: Aug 2011
Location: Bangalore, India
Distribution: RHEL 7.x, SLES 11 SP2/3/4
Posts: 1,195
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
Here follow this blog for Creating Samba Share


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
Samba share not accessible access is denied error message kaplan71 Linux - Software 3 06-25-2010 11:37 AM
Samba Share = Network Access is Denied surban99 Linux - Software 2 04-10-2009 02:54 PM
Access denied when attempting access samba share warlockvix Linux - Software 1 05-11-2007 03:36 PM
Very stupid, but here we go: pam_mount + samba share = access denied? Thakowbbery Linux - Software 8 05-23-2005 11:43 AM
Samba Share SMB.CONF Access Denied mikeaustn Linux - Software 1 09-28-2004 04:14 PM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:22 AM.

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