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: 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 To: python-list@python.org Subject: Re: Create a file in /etc/ as a non-root user In-Reply-To: References: <0e688580-c0fb-4caf-8fb1-f622b2c7bcb5@googlegroups.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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: 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 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