X-Spam-Check-By: sourceware.org Message-ID: <001401c694ba$f39c9130$7e8f443d@elshaddai> From: "Stephen Grant Brown" To: References: <002101c69200$3887d880$ec8b443d AT elshaddai> Subject: Re: Running as root Date: Wed, 21 Jun 2006 08:43:27 +1000 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit 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: List-Archive: List-Post: List-Help: , 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" To: "Stephen Grant Brown" Cc: 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: . 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 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/