Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #46641

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

Date 2013-05-31 19:49 -0500
From Tim Chase <python.list@tim.thechases.com>
Subject Re: Create a file in /etc/ as a non-root user
References <0e688580-c0fb-4caf-8fb1-f622b2c7bcb5@googlegroups.com> <pan.2013.06.01.00.20.14.288000@nowhere.com>
Newsgroups comp.lang.python
Message-ID <mailman.2515.1370047650.3114.python-list@python.org> (permalink)

Show all headers | View raw


On 2013-06-01 01:20, Nobody 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?
> 
> This should not be possible. The language used is irrelevant.

It's theoretically possible to pre-create the file (or a
subdirectory) in /etc as root, then "chown" it to have a group for
which certain users can be members.  Something like

  $ su -   # or "sudo sh"
  # addgroup bibhusers
  # mkdir /etc/bibhu
  # chown :bibhusers /etc/bibhu
  # chmod g+rwx /etc/bibhu
  # for user in bibhu tim guido; do adduser $user bibhusers ; done
  # exit
  $ logout

Upon next login, the users listed in the "for user in ..." command
should have write access to the directory created in /etc

Not that this would generally be considered a good idea, but if you
wanted to have a global configuration and wanted select users (as
members of a defined group) to have the ability to tweak this global
configuration, this is how it would be done.  Otherwise, it's
generally advisable to just have one admin maintain the global
configuration file and then give users a local (in
$HOME/.config/$APPNAME/filename.ext) configuration file to override
those global settings.

-tkc


Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Create a file in /etc/ as a non-root user BIBHU DAS <b13das91@gmail.com> - 2013-05-31 02:12 -0700
  Re: Create a file in /etc/ as a non-root user Luca Cerone <luca.cerone@gmail.com> - 2013-05-31 02:27 -0700
    Re: Create a file in /etc/ as a non-root user Dave Angel <davea@davea.name> - 2013-05-31 07:11 -0400
      Re: Create a file in /etc/ as a non-root user Alister <alister.ware@ntlworld.com> - 2013-05-31 14:02 +0000
        Re: Create a file in /etc/ as a non-root user Chris Angelico <rosuav@gmail.com> - 2013-06-01 00:42 +1000
          Re: Create a file in /etc/ as a non-root user rusi <rustompmody@gmail.com> - 2013-05-31 21:39 -0700
  Re: Create a file in /etc/ as a non-root user Nobody <nobody@nowhere.com> - 2013-06-01 01:20 +0100
    Re: Create a file in /etc/ as a non-root user Tim Chase <python.list@tim.thechases.com> - 2013-05-31 19:49 -0500
  Re: Create a file in /etc/ as a non-root user Denis McMahon <denismfmcmahon@gmail.com> - 2013-06-01 21:19 +0000
    Re: Create a file in /etc/ as a non-root user rusi <rustompmody@gmail.com> - 2013-06-01 19:51 -0700

csiph-web