LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 10-02-2012, 09:57 PM   #1
PlorkZ
Member
 
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:
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!
 
Old 10-02-2012, 11:30 PM   #2
markie83
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

[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
 
Old 10-04-2012, 06:25 PM   #3
PlorkZ
Member
 
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:

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.
 
Old 10-06-2012, 01:33 PM   #4
jettwa2001
Member
 
Registered: Dec 2007
Posts: 36

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, 10:54 PM   #5
PlorkZ
Member
 
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, 12:52 AM   #6
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: rhel 5x,6.0,6.2, centOS 5x,6.0,6.2
Posts: 1,188
Blog Entries: 4

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


Reply


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


All times are GMT -5. The time now is 05:57 PM.

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