LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > *BSD
User Name
Password
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.

Notices


Reply
  Search this Thread
Old 03-10-2009, 06:42 AM   #1
Peter Aleksic
LQ Newbie
 
Registered: Nov 2004
Location: Belgrade, Serbia
Distribution: CentOS, Debian, FreeBSD
Posts: 10

Rep: Reputation: 0
[SOLVED] Permission denied on Samba share


I have a samba server setup locally and I can connect to the specified shared home drive on the FreeBSD Server from the Linux and Windows machines.

I can delete, save or create only single files and folders but when i try to copy, move folders I get an "Permission Denied" error message.

Everything appears to be correct to allow full access to users so I dont know what is happening. Anyone got any advice?

Thanks

Code:
paleksic@overlord ~ 0 $ sudo mount -t cifs //192.168.1.3/Unix /mnt/samba -o username=paleksic,password=xxxxxxxx,uid=paleksic,gid=users,rw,iocharset=utf8,file_mode=0777,dir_mode=0777
paleksic@overlord ~ 0 $ cd /mnt/samba/
paleksic@overlord samba 0 $ mkdir test
paleksic@overlord samba 0 $ cd test/
paleksic@overlord test 0 $ touch 1 2 3
paleksic@overlord test 0 $ ll
-rw-r--r-- 1 paleksic users 0 2009-03-10 12:20 1
-rw-r--r-- 1 paleksic users 0 2009-03-10 12:20 2
-rw-r--r-- 1 paleksic users 0 2009-03-10 12:20 3
paleksic@overlord samba 130 $ cp -R /home/paleksic/documents/multimedia/Video/divx/Futurama.Benders.Game.2008.DVDRip.XviD-DOMiNO .
cp: cannot create regular file `./Futurama.Benders.Game.2008.DVDRip.XviD-DOMiNO/domino-futuramabg.avi': Permission denied
cp: cannot create regular file `./Futurama.Benders.Game.2008.DVDRip.XviD-DOMiNO/domino-futuramabg.srt': Permission denied

Code:
[ ] LDAP         With LDAP support  
[ ] ADS          With Active Directory support                
[ ] CUPS         With CUPS printing support                   
[X] WINBIND      With WinBIND support 
[ ] SWAT         With SWAT
[ ] ACL_SUPPORT  With ACL support                     
[ ] AIO_SUPPORT  With Asyncronous IO support           
[ ] FAM_SUPPORT  With File Alteration Monitor              
[X] SYSLOG       With Syslog support                          
[ ] QUOTAS       With Disk quota support                      
[X] UTMP         With UTMP accounting support 
[ ] PAM_SMBPASS  With PAM authentication vs passdb backends
[ ] DNSUPDATE    With dynamic DNS update(require ADS)        
[ ] DNSSD        With DNS service discovery support           
[ ] EXP_MODULES  With experimental modules

Code:
[root@medved ~]# cat /usr/local/etc/smb.conf
[global]                                    
   workgroup = OVERLORDW                    
   server string = FreeBSD Server
   encrypt passwords = yes
   security = user
   load printers = no
;   max log size = 100
   interfaces = 192.168.2.1 192.168.1.3
   local master = yes
   os level = 99
   domain master = no
   preferred master = no
   dns proxy = no
;  disable netbios = yes


[Unix]
   comment = Unix Share Folder
   path = /home/paleksic/samba
   valid users = paleksic
   public = no
   guest ok = no
   browseable = yes
   writable = yes
   printable = no
Code:
[root@medved /var/log/samba]# tail -n 7 log.smbd
[2009/03/10 12:17:46,  1] smbd/service.c:make_connection_snum(1103)
  192.168.2.250 (192.168.2.250) connect to service Unix initially as user paleksic (uid=1002, gid=1002) (pid 59611)
[2009/03/10 12:17:46,  1] smbd/service.c:close_cnum(1315)
  192.168.2.250 (192.168.2.250) closed connection to service Unix
[2009/03/10 12:18:30,  1] smbd/service.c:make_connection_snum(1103)
  192.168.2.250 (192.168.2.250) connect to service Unix initially as user paleksic (uid=1002, gid=1002) (pid 59612)

Last edited by Peter Aleksic; 03-10-2009 at 11:26 AM.
 
Old 03-10-2009, 07:11 AM   #2
dracofhc
Member
 
Registered: Dec 2005
Location: Kalamazoo, MI, US
Distribution: Gentoo
Posts: 44

Rep: Reputation: 16
Did you double check to make sure you have write permission on the directory you're trying to copy into, not just for the other files around it?
 
Old 03-10-2009, 08:35 AM   #3
Peter Aleksic
LQ Newbie
 
Registered: Nov 2004
Location: Belgrade, Serbia
Distribution: CentOS, Debian, FreeBSD
Posts: 10

Original Poster
Rep: Reputation: 0
Permissions appears to be correct to allow full access to user

Code:
paleksic@overlord mnt 0 $ id
uid=1000(paleksic) gid=100(users) groups=10(wheel),33(http),81(dbus),82(hal),91(video),92(audio),93(optical),95(storage),98(power),100(users),503(fuse),504(paleksic)
paleksic@overlord mnt 0 $ ls -ld /mnt/samba/
drwxr-xr-x 3 paleksic users 0 2009-03-10 14:14 /mnt/samba/
paleksic@overlord mnt 0 $ mount | grep samba
//192.168.1.3/Unix on /mnt/samba type cifs (rw,mand)

how is this even possible
Code:
paleksic@overlord mnt 0 $ cp -R /home/paleksic/Desktop/Downloads/screenshots samba/
cp: cannot create regular file `samba/screenshots/snapshot1.png': Permission denied
cp: cannot create regular file `samba/screenshots/snapshot2.png': Permission denied
paleksic@overlord mnt 1 $ cp -R /home/paleksic/Desktop/Downloads/screenshots samba/
paleksic@overlord mnt 0 $
 
Old 03-10-2009, 11:24 AM   #4
Peter Aleksic
LQ Newbie
 
Registered: Nov 2004
Location: Belgrade, Serbia
Distribution: CentOS, Debian, FreeBSD
Posts: 10

Original Poster
Rep: Reputation: 0
Thumbs up Solved

The UID and GID of the users do not match on the server and client, so user have no proper rights to files in mounted shares on his local machine. I changed UID/GID's in the Linux box to bring them in sync with FreeBSD and as a result I can write to the share.
 
Old 03-19-2009, 04:47 PM   #5
juleslinux
LQ Newbie
 
Registered: Oct 2005
Distribution: Red Hat & Ubuntu
Posts: 3

Rep: Reputation: 0
Talking Samba Permission Denied Solution

I was having the same "Permission Denied" trying to connect via Windows or Linux to Samba box. Tried multiple things for days, but the following worked for me, so I hope it helps someone else out there!

I am running SLES 9, SP4.

AppArmor is the problem on SLES 10. On SLES 9, it's called subdomain.

Stop the service and disable on boot if you don't need the app.

disable it with "rcapparmor stop" (SLES 10)

/etc/init.d/boot.subdomain stop" (SLES 9).
 
Old 03-20-2009, 08:18 AM   #6
netman4ttm
Member
 
Registered: Aug 2007
Distribution: FreeBSD 8.0 xubuntu
Posts: 49

Rep: Reputation: 16
add this to your [Unix] share
force user = paleksic

I noticed you used windbind, unless you are using a domain it is not needed and should not be enabled in the rc.conf.

Last edited by netman4ttm; 03-20-2009 at 08:20 AM. Reason: adding stuff
 
  


Reply



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 Mounts but Permission Denied pccdrussell Linux - Software 1 12-16-2007 06:21 AM
Permission denied trying to mount nfs share leupi Linux - Networking 1 07-30-2007 01:32 AM
nfs share: permission denied Kropotkin *BSD 11 01-10-2007 08:15 AM
Can't access my linux share through samba. I get permission denied. mlsbraves Linux - Software 1 08-16-2005 07:59 PM
Mounting an nfs share - Permission Denied doctorwebbox Linux - Networking 5 05-30-2005 01:45 AM

LinuxQuestions.org > Forums > Other *NIX Forums > *BSD

All times are GMT -5. The time now is 02:52 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration