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

Path csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python.list@tim.thechases.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.006
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'subject:file': 0.07; 'exit': 0.09; 'override': 0.09; 'root,': 0.09; 'skip:$ 30': 0.09; '-tkc': 0.16; 'from:addr:python.list': 0.16; 'from:addr:tim.thechases.com': 0.16; 'from:name:tim chase': 0.16; 'mkdir': 0.16; 'subject:non': 0.16; 'subject:user': 0.16; 'tweak': 0.16; 'user?': 0.16; 'language': 0.16; 'wrote:': 0.18; 'command': 0.22; 'select': 0.22; '(in': 0.22; 'admin': 0.22; 'otherwise,': 0.22; 'settings.': 0.24; '(or': 0.24; 'certain': 0.27; 'defined': 0.27; 'header:In-Reply-To:1': 0.27; 'idea': 0.28; 'generally': 0.29; 'tim': 0.29; '-0700,': 0.31; 'idea,': 0.31; 'file': 0.32; 'fri,': 0.33; 'created': 0.35; 'possible.': 0.35; 'something': 0.35; 'done.': 0.35; 'but': 0.35; 'done': 0.36; 'next': 0.36; 'das': 0.36; 'charset:us-ascii': 0.36; 'possible': 0.36; 'should': 0.36; 'members.': 0.37; 'to:addr:python-list': 0.38; 'ability': 0.39; 'to:addr:python.org': 0.39; 'users': 0.40; 'how': 0.40; 'nobody': 0.68; 'group)': 0.84; 'login,': 0.84; 'received:50.22': 0.84; '2013': 0.98
Date Fri, 31 May 2013 19:49:19 -0500
From Tim Chase <python.list@tim.thechases.com>
To python-list@python.org
Subject Re: Create a file in /etc/ as a non-root user
In-Reply-To <pan.2013.06.01.00.20.14.288000@nowhere.com>
References <0e688580-c0fb-4caf-8fb1-f622b2c7bcb5@googlegroups.com> <pan.2013.06.01.00.20.14.288000@nowhere.com>
X-Mailer Claws Mail 3.7.6 (GTK+ 2.20.1; x86_64-pc-linux-gnu)
Mime-Version 1.0
Content-Type text/plain; charset=US-ASCII
Content-Transfer-Encoding 7bit
X-AntiAbuse This header was added to track abuse, please include it with any abuse report
X-AntiAbuse Primary Hostname - boston.accountservergroup.com
X-AntiAbuse Original Domain - python.org
X-AntiAbuse Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse Sender Address Domain - tim.thechases.com
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2515.1370047650.3114.python-list@python.org> (permalink)
Lines 35
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1370047650 news.xs4all.nl 15899 [2001:888:2000:d::a6]:34605
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:46641

Show key headers only | 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