Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
12-05-2011, 08:05 PM
|
#1
|
|
LQ Newbie
Registered: Nov 2011
Posts: 18
Rep: 
|
permission [Make my files readable ,writable but couldnot be delete] ?
Dear Everyone
i fell some critical thinking when setting permission for my files & directories on share zone(samba,ftp). i try to set their permission in such a way that a registered user can read & write but couldn't delete a file.
Thnaks in advance.
sorry for my bad english.
please help
Last edited by rabir; 12-05-2011 at 09:23 PM.
|
|
|
|
12-05-2011, 08:11 PM
|
#2
|
|
Guru
Registered: Apr 2005
Location: /dev/null
Distribution: technixOS
Posts: 5,723
|
Deleted due to confusion.
Last edited by corp769; 12-06-2011 at 07:01 AM.
|
|
|
0 members found this post helpful.
|
12-05-2011, 10:42 PM
|
#3
|
|
LQ Newbie
Registered: Nov 2011
Posts: 18
Original Poster
Rep: 
|
protect my files & directories to delete ?
Dear all
greetings.
i set permission on FTP files & directories as 644 & 755. but some users can delete the files inside in. how could i make my files non-deletable ?
thanks in advance for replies
|
|
|
|
12-05-2011, 10:48 PM
|
#4
|
|
Guru
Registered: Apr 2005
Location: /dev/null
Distribution: technixOS
Posts: 5,723
|
Deleted.
Last edited by corp769; 12-06-2011 at 06:45 AM.
|
|
|
1 members found this post helpful.
|
12-06-2011, 12:12 AM
|
#5
|
|
LQ Newbie
Registered: Nov 2011
Posts: 18
Original Poster
Rep: 
|
thanks for response
my samba share configuration here
/*
[samba]
comment=public stuff
path=/samba
public=yes
create mask=0664
directory mask=0775
writable=yes
*/
now i try to protect my files to delete.
in my exixting configuration it is available to create & access.
|
|
|
|
12-06-2011, 04:51 AM
|
#6
|
|
Senior Member
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 11.4
Posts: 1,314
|
The thread started with FTP, not Samba. Are you now trying to configure an FTP server or Samba?
|
|
|
|
12-06-2011, 05:00 AM
|
#7
|
|
Senior Member
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 11.4
Posts: 1,314
|
If you grant write access to a file, it could also be emptied. Is this what you want? Usually it’s set up by disallowing a write to the directory itself (but then they also couldn’t create a file).
|
|
|
|
12-06-2011, 05:59 AM
|
#8
|
|
Member
Registered: Jan 2011
Location: İstanbul
Distribution: Slackware,Debian
Posts: 62
Rep:
|
I hope sticky bit solve your problem .
If you add sticky bit to parent directory of files, anyone can't remove files in directory.Only file's owner can remove files
Code:
chmod +t <parent directory of your files>
See : http://en.wikipedia.org/wiki/Sticky_bit
|
|
|
|
12-06-2011, 06:17 AM
|
#9
|
|
Guru
Registered: Apr 2005
Location: /dev/null
Distribution: technixOS
Posts: 5,723
|
Deleted. Sorry for any inconveniences.....
Last edited by corp769; 12-06-2011 at 06:45 AM.
|
|
|
|
12-06-2011, 06:54 AM
|
#10
|
|
Senior Member
Registered: Aug 2011
Location: Bangalore, India
Distribution: rhel 5x,6.0,6.2, centOS 5x,6.0,6.2
Posts: 1,159
|
I hope you know about sticky bit
You can use this
Code:
#chmod 1664 /path/to/share
or
#chmod -R 1664 /path/to/share
change the permission as per your requirements and "1" represents sticky bit
check this link for more information on sticky bit
http://www.linuxquestions.org/questi...d-sgid-258719/
|
|
|
|
12-06-2011, 06:56 AM
|
#11
|
|
Senior Member
Registered: Aug 2011
Location: Bangalore, India
Distribution: rhel 5x,6.0,6.2, centOS 5x,6.0,6.2
Posts: 1,159
|
Quote:
Originally Posted by rabir
Dear Everyone
i fell some critical thinking when setting permission for my files & directories on share zone(samba,ftp). i try to set their permission in such a way that a registered user can read & write but couldn't delete a file.
Thnaks in advance.
sorry for my bad english.
please help
|
you have asked same type of question in two threads....?
http://www.linuxquestions.org/questi...delete-917320/
|
|
|
|
12-06-2011, 07:00 AM
|
#12
|
|
Guru
Registered: Apr 2005
Location: /dev/null
Distribution: technixOS
Posts: 5,723
|
Ahh, that's why I referred to samba in that other one originally. I wasn't crazy after all! Thanks for pointing that out. Reporting this thread to be closed, since this thread is newer.
|
|
|
|
12-06-2011, 07:16 AM
|
#13
|
|
Senior Member
Registered: Aug 2011
Location: Bangalore, India
Distribution: rhel 5x,6.0,6.2, centOS 5x,6.0,6.2
Posts: 1,159
|
Quote:
Originally Posted by corp769
Ahh, that's why I referred to samba in that other one originally. I wasn't crazy after all! Thanks for pointing that out. Reporting this thread to be closed, since this thread is newer.
|
Well if you are closing that thread then I will repost my answer in this thread
Quote:
Originally Posted by rabir
Dear Everyone
i fell some critical thinking when setting permission for my files & directories on share zone(samba,ftp). i try to set their permission in such a way that a registered user can read & write but couldn't delete a file.
Thnaks in advance.
sorry for my bad english.
please help
|
I hope you know about sticky bit
You can use this
Code:
#chmod 1664 /path/to/share
or
#chmod -R 1664 /path/to/share
change the permission as per your requirements and "1" represents sticky bit
check this link for more information on sticky bit
http://www.linuxquestions.org/questi...d-sgid-258719/
|
|
|
|
12-06-2011, 07:17 AM
|
#14
|
|
Guru
Registered: Apr 2005
Location: /dev/null
Distribution: technixOS
Posts: 5,723
|
+1 to the sticky bit.
And sorry for any confusion before within my posts. I deleted them because nothing seemed right after reading them.
|
|
|
1 members found this post helpful.
|
12-06-2011, 07:30 AM
|
#15
|
|
Guru
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 18 with Awesome WM
Posts: 6,796
|
Hello,
You could also check out chattr. The advantage is that whatever attributes you change will not show with an ordinary ls, you'll need lsattr. And only root can change the attributes if you need to change them again.
Quote:
DESCRIPTION
chattr changes the file attributes on a Linux file system.
The format of a symbolic mode is +-=[acdeijstuADST].
The operator `+' causes the selected attributes to be added to the existing attributes of the files; `-' causes them to be removed; and `=' causes them to
be the only attributes that the files have.
The letters `acdeijstuADST' select the new attributes for the files: append only (a), compressed (c), no dump (d), extent format (e), immutable (i), data
journalling (j), secure deletion (s), no tail-merging (t), undeletable (u), no atime updates (A), synchronous directory updates (D), synchronous updates
(S), and top of directory hierarchy (T).
The following attributes are read-only, and may be listed by lsattr(1) but not modified by chattr: huge file (h), compression error (E), indexed directory
(I), compression raw access (X), and compressed dirty file (Z).
|
Kind regards,
Eric
|
|
|
1 members found this post helpful.
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 05:21 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|