LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   *BSD (https://www.linuxquestions.org/questions/%2Absd-17/)
-   -   Permission denied on Samba share (https://www.linuxquestions.org/questions/%2Absd-17/permission-denied-on-samba-share-710453/)

Peter Aleksic 03-10-2009 06:42 AM

[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)


dracofhc 03-10-2009 07:11 AM

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?

Peter Aleksic 03-10-2009 08:35 AM

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)


:eek: 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 $


Peter Aleksic 03-10-2009 11:24 AM

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.

juleslinux 03-19-2009 04:47 PM

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).

netman4ttm 03-20-2009 08:18 AM

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.


All times are GMT -5. The time now is 11:25 AM.