LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 03-31-2013, 04:50 AM   #1
openlinux
LQ Newbie
 
Registered: Mar 2013
Posts: 8

Rep: Reputation: Disabled
can not delete files from samba share


hi,

i have a samba share on one of my debian servers with the following section:

[Torrent]
writeable = yes
path = /path_to_downloads
public = yes
guest ok = yes
guest only = yes
guest account = nobody
browseable = yes

when i paste some files into the share or create a directory, from my linux laptop, everything went ok, but i am not able to delete the downloads from sabnzbd or torent, form my linux laptop.

pls help, thanks

Last edited by openlinux; 03-31-2013 at 05:01 AM.
 
Old 03-31-2013, 05:41 AM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
What is the ownership and permissions of the directory and the files.
What is the value of "guest account ="?

I suspect that the sticky bit is set on the directory and the files have a different owner.
Also check the Samba logs. It may give more details.

Post the global part of smb.conf in code tags. Run testparm to check smb.conf's validity.

Last edited by jschiwal; 03-31-2013 at 05:46 AM.
 
Old 03-31-2013, 05:48 AM   #3
openlinux
LQ Newbie
 
Registered: Mar 2013
Posts: 8

Original Poster
Rep: Reputation: Disabled
there is no ownership, for as far i know.
i created the dir Torrent by using root, and did chmod 777 Torrent, nothing else

in smb.conf, in section Homes
ceate mask = 0700
directory mask = 0700
 
Old 03-31-2013, 05:56 AM   #4
openlinux
LQ Newbie
 
Registered: Mar 2013
Posts: 8

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jschiwal View Post
What is the ownership and permissions of the directory and the files.
What is the value of "guest account ="?

Post the global part of smb.conf in code tags. Run testparm to check smb.conf's validity.
Code:
[global]

## Browsing/Identification ###

# Change this to the workgroup/NT-domain name your Samba server will part of
   workgroup = WORKGROUP

# server string is the equivalent of the NT Description field
   server string = %h server

# Windows Internet Name Serving Support Section:
# WINS Support - Tells the NMBD component of Samba to enable its WINS Server
#   wins support = no

# WINS Server - Tells the NMBD components of Samba to be a WINS Client
# Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
;   wins server = w.x.y.z

# This will prevent nmbd to search for NetBIOS names through DNS.
   dns proxy = no

# What naming service and in what order should we use to resolve host names
# to IP addresses
;   name resolve order = lmhosts host wins bcast
 
Old 03-31-2013, 06:04 AM   #5
openlinux
LQ Newbie
 
Registered: Mar 2013
Posts: 8

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jschiwal View Post
Run testparm to check smb.conf's validity.
1 error:

the security=share option is deprecated
 
Old 03-31-2013, 06:25 AM   #6
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Show the output of "ls -ld path_to_downloads". Show the same for one of the files and one of the directories inside the share.

If you have the ownership of root and 0700 permissions, I'm surprised you can write to the directory. Only root has permissions, and the connection is made as "nobody" (guest user on the Windows side.)

It would be better to use user level security and configure the ownership and permissions the same as the /tmp directory. The client can save the credentials, so you can use user level security without needing the password every time. You could even create a user "torrent" on the server giving you the features of share level security.

Check out the book "Samba 3 by Example". It should be available on the samba.org website. If your distro has a samba-docs package, that contains a PDF version of the book as well. It contains step-by-step instructions for several types of services. Creating the directory with proper ownership and permissions, and adding users with smbpasswd are two often skipped steps.

Last edited by jschiwal; 03-31-2013 at 06:32 AM.
 
Old 04-01-2013, 09:57 AM   #7
pix9
Member
 
Registered: Jan 2010
Location: Mumbai, India
Distribution: ArchLinux, Fedora 24, Centos 7.0
Posts: 177

Rep: Reputation: 19
which distribution are you using?

If your distribution is Redhat Enterprise Linux then you can try out following thing.

if you are running Redhat Linux possible reason I know of is SELinux if it is in enforcing mode it will stop you from writing content on any folder which doesn't have appropriate security context on it.

run following command to view mode of selinux
Code:
$ getenforce
if output is some thing like this

Code:
$ getenforce
Enforcing
then you must run following command of your share directory
Code:
chcon  -R -t public_content_rw_t /path/your/samba/share/directory
Note: don't forget to replace /path/your/samba/share/directory your samba's share directory.

hope that helps you.


regards
pix
 
Old 04-01-2013, 07:07 PM   #8
adayforgotten
LQ Newbie
 
Registered: Apr 2013
Location: USA
Distribution: Ubuntu
Posts: 9

Rep: Reputation: Disabled
Quote:
Originally Posted by openlinux View Post
there is no ownership, for as far i know.
i created the dir Torrent by using root, and did chmod 777 Torrent, nothing else

in smb.conf, in section Homes
ceate mask = 0700
directory mask = 0700
If you have the files owned by root, the create mask MUST set the 'other' to 7 (rwx)
Since you are already using /path/to/Torrent as chmod 777, you might as well set new items to the same (=0777). As others pointed out, properly permissioning the folder and files to be owned by a user other than root would be prudent.
 
  


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 cant delete files from window machine salimshahzad Linux - Newbie 3 06-22-2011 12:58 AM
some one delete the directory from samba share mianmajidali Linux - Server 1 04-11-2009 07:47 AM
cant delete files from samba share from vista machine get permission error Elnegro8 Linux - Server 3 02-20-2009 07:17 AM
can not delete NON-EMPTY directories through samba share Sandor Linux - Software 2 02-16-2006 03:06 AM
samba share with write but not delete Red Squirrel Linux - Software 7 08-29-2004 06:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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

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