Create a file in /etc/ as a non-root user

rusi rustompmody at gmail.com
Sat Jun 1 22:51:33 EDT 2013


On Jun 2, 2:19 am, Denis McMahon <denismfmcma... at gmail.com> wrote:
> On Fri, 31 May 2013 02:12:58 -0700, BIBHU DAS wrote:
> > Any Idea how to create a file in /etc as non-root user?Can i use umask
> > or chmod.......confused
>
> If you don't have root access, you probably shouldn't be trying to write
> in /etc. If you need to write in /etc, explain to the sysadmin why you
> need root access.

The OP is evidently working on a macbook pro.
>From which I infer its his own personal notebook.
So 'explain to the sysadmin' amounts to explain to oneself!!

40 years ago, on the first Unices, with machines millions of times
weaker and costlier than today, 'sysadmin' and 'normal user' were
usually different. Today they are usually the same.

So we old Unix-heads need to change our explanations from 'explain to
the sysadmin' to 'change hat from normal-user to superuser'.  And then
why simplifying life by having only one hat --
$ sudo bash # and do everything there
is not such a good idea!

To the OP:
One thing that has not changed in 40 (or rather 60) years is the
concept of binding times.
eg C programmers cannot get off the ground if they do not distinguish
compile-time from run-time.

In the current context, it is probably good to distinguish system-
admining time from system-use time.
So as sysadmin, you can pretty much do as you please (though remember
my comments earlier on respecting your distro's space), make a
directory under /etc, chmod, chown, chgrp it to your taste, so that
the (group of) ordinary users can write to it.

And then in normal user mode you should be able to write to it.

However... as I said above it may be preferable to use /usr/local (for
programs) or /var (for data) rather than mess in /etc. [Think of /etc
as windows' registry]  Study the FHS to make the right choice.

And finally, if you are the only guy involved, why are you not doing
everything under $HOME?



More information about the Python-list mailing list