delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/06/20/18:43:49

X-Spam-Check-By: sourceware.org
Message-ID: <001401c694ba$f39c9130$7e8f443d@elshaddai>
From: "Stephen Grant Brown" <s_g_brown AT aapt DOT net DOT au>
To: <cygwin AT cygwin DOT com>
References: <002101c69200$3887d880$ec8b443d AT elshaddai> <Pine DOT GSO DOT 4 DOT 63 DOT 0606171347240 DOT 25057 AT access1 DOT cims DOT nyu DOT edu>
Subject: Re: Running as root
Date: Wed, 21 Jun 2006 08:43:27 +1000
MIME-Version: 1.0
X-Mailer: Microsoft Outlook Express 6.00.2900.2869
X-BitDefender-Scanner: Clean, Agent: BitDefender POSTFIX 1.6.0 on vfep3
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Hi All
----- Original Message ----- 
From: "Igor Peshansky" <pechtcha AT cs DOT nyu DOT edu>
To: "Stephen Grant Brown" <s_g_brown AT aapt DOT net DOT au>
Cc: <cygwin AT cygwin DOT com>
Sent: Sunday, June 18, 2006 3:56 AM
Subject: Re: Running as root


> On Sat, 17 Jun 2006, Stephen Grant Brown wrote:
>> Hi There
>>
>> I would like to run programs as root, which means the userid and group
>> need to be set to 0, and the name needs to = root.
>>
>> I have looked through the ntsec.html document and I afraid it is too
>> complicated for me to understand.
>>
>> Can somebody explain how to do this to me in a more simplified format
>> please?
>
> That depends on what you want to do.  If you are sure your login account
I want to run backup and restore programs, and also a program which will 
tell me which files have changed to make a program stop working.
> has enough privileges, and you simply have a program that non-portably
How do I determine if my login account has enoungh priverledges?
I know my default login account of stephen does not have a uid and gid of 0
I cannot login to administrator.
> checks whether you're running as root (and you don't have the ability to
> properly fix the program), you can read the following section of the above
> document: <http://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-sids>.  It

The third line of the above reference reads

 Both files may now contain SIDs of users and groups. They are saved in the 
last field of pw_gecos in /etc/passwd and in the gr_passwd field in 
/etc/group.

What is a SID?
What is pw_gecos?

Typing "man -a passwd" does not tell the fields in the /etc/passwd

> also helps to know that it's ok to have multiple entries in the passwd
> file for the same user -- forward lookups by SID find the first entry with
> that SID, and reverse lookups by user will find any entry with that
> username/userid.  So you can simply add an entry for
> "root::0:513:YOURSID:...", and make sure it precedes the actual entry for

What is the rest of this "root::0:513:..." line?

> your account, and any program checking your effective userid (e.g., "id")
> will show you as "root" with UID of 0.
>
> If you really do need to do root'y stuff, e.g., switch user contexts, etc,
> then read <http://cygwin.com/cygwin-ug-net/ntsec.html#ntsec-switch> and
> Google for "SYSTEM-owned bash shell" to see how to start processes as
> SYSTEM (sshd doesn't let you switch to SYSTEM, unfortunately, unless you
> use public key authentication, as you normally don't know and have no
> control over the password for SYSTEM).
> Igor

Thanks for your understanding. I am still finding a lot of this advice too 
complicated for my simple brain.
Yours Sincerely Stephen Grant Brown 


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019