I have created different users and set their home directories to particular folders. I have limited the users' access other than their directories. How could I limit users from writing data?
Asked
Active
Viewed 146 times
-1
-
Write data to where? – Naveen Jun 04 '14 at 14:02
-
it just storing data may be i create file or any thing that consumes disk space – Dipak Jun 04 '14 at 14:06
-
Not allowing writing data in their own HOME directory will break their login (files need to be written in /home/$USER by the system with the user name. UNLESS we are talking about ftp I would not touch /HOME/$USER – Rinzwind Jun 04 '14 at 14:06
-
Rinzwind, it's not that big of a deal. Not every file needs to be kept writeable. As long as files are still kept readable to the user, all works out fine. – mmstick Jun 04 '14 at 14:10
-
i don,t want to restrict writing data in their own HOME directory , i want they just able to write in home directory with limited data size @Rinzwind – Dipak Jun 04 '14 at 14:12
-
Your question makes no sense to me. Please try to explain with an example. – Naveen Jun 04 '14 at 14:13
-
3It sounds like the question is about user/group disk quotas – steeldriver Jun 04 '14 at 14:13
-
Naveen, his question makes perfect sense if you understand English. – mmstick Jun 04 '14 at 14:14
-
+1 steeldriver. Yes that sounds like a disk quota thing. @mmstick no it is not. – Rinzwind Jun 04 '14 at 14:17
-
Thanks steeldriver , I am not having any knowledge about user/group disk quotas , but how can it will be useful to me @steeldriver – Dipak Jun 04 '14 at 14:18
-
@Dipak the link above points to this http://www.thegeekstuff.com/2010/07/disk-quota/ and it explains how to set up a partition with limited disc space per user. – Rinzwind Jun 04 '14 at 14:19
-
@Rinzwind it seems to be i need to install quota and modify /etc/fstab and reboot system. i want to add user at run time using scripts as per need , and i am not reboot system because it will break other users from uploading data to their directories – Dipak Jun 04 '14 at 14:26
1 Answers
0
See the chmod
and chown
command using man
. You can modify files and directories so that they belong to root and are not writeable by anyone other than root, for example.
Example (as root): chown root:root file

mmstick
- 1,907
-
1Careful: do this in
/home
or with some files in/home/$USER/
and the user will not be able to login. – Rinzwind Jun 04 '14 at 14:08 -
-
Who needs a wall of text when a concise answer is all you need? There's a difference between laziness and being concise. – mmstick Jun 04 '14 at 14:15