in reply to Re^2: Best way to write to a file owned by root?
in thread Best way to write to a file owned by root?
Hello again,
I was thinking about the case that you where describing. "Best way to write to a file owned by root?"
I did a bit of search on the web and there is an alternative. Give root privileges to an user just for a specific directory closed, the proposed solution is:
Taken from the question:
You do not need root permissions - you need group permissions. For example if the group is www-data, do something along the lines of usermod -a -G www-data misterX and make sure the files are group-writable.
It is not bad as a solution to add your user in a group strictly to update the /etc/hosts file. But to be honest I do not know how vulnerable it becomes your file regarding security.
Maybe another monk who has more knowledge regarding security issues can provide more information.
But this could be a solution in avoiding using Sudo module.
Hope this is a better solution.
No matter what you decide at the end, post your solution here, it is interesting. :D
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Best way to write to a file owned by root?
by afoken (Chancellor) on Mar 14, 2017 at 21:32 UTC | |
by nysus (Parson) on Mar 14, 2017 at 22:25 UTC | |
by afoken (Chancellor) on Mar 15, 2017 at 06:42 UTC | |
by nysus (Parson) on Mar 15, 2017 at 14:09 UTC | |
by hippo (Archbishop) on Mar 15, 2017 at 14:52 UTC | |
| |
|
Re^4: Best way to write to a file owned by root?
by nysus (Parson) on Mar 14, 2017 at 20:21 UTC | |
by Anonymous Monk on Mar 14, 2017 at 21:37 UTC |