delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2013/10/15/17:55:41

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:from:mime-version:content-type
:content-transfer-encoding:message-id:date:to:subject; q=dns; s=
default; b=jCLc3rGIVe6e4wstrsEEdC0wJr/KTqD/q6lbObgOO1BSCEPcffIUw
0fuq+jZ3Zmdpyyvhv6mFZ0IIwCMC1tmUdAsUnHrHtLZYb5AtpmHAYooQpdNyhafT
M8hlxk7SQ8DvievO+omspx5TGH2/DPDMafKltJPW/5ph785XUmw82c=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:from:mime-version:content-type
:content-transfer-encoding:message-id:date:to:subject; s=
default; bh=nktbSVUuQAGnhErMJ+LFC49gWeI=; b=q69vbOrT673g/tidp0OJ
ZTJThj7wQupYdQcVqLHPoeNuoBS1lEWorM7zD2evnjpbW5Nd9M+BxAWodMO1PHew
NqYol6oWiaOQJnq21q/qAYYCf5AYmyyqatuVB5MjDGPm0Hwau3/qOZeq0bdaKf4R
TecPqQpVvrb9y3WXhhyRCXA=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
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
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=1.9 required=5.0 tests=AWL,BAYES_05,RCVD_IN_DNSWL_NONE,T_MANY_HDRS_LCASE autolearn=ham version=3.3.2
X-HELO: vms173013pub.verizon.net
From: <cygwin AT kosowsky DOT org>
MIME-version: 1.0
Message-id: <21085.47545.572257.639431@consult.pretender>
Date: Tue, 15 Oct 2013 17:55:05 -0400
To: cygwin AT cygwin DOT com
Subject: Root/Administrator privileges from cygwin terminal
X-IsSubscribed: yes

I have 2 questions regarding root/administrator
privileges but have not been able to find any clear answers via googling.

1. Is it possible to run a command (including potentially a new bash
   shell) as Administrator/root (Group 544) from a non-administrator bash
   shell?

   Note that using windows 'runas' fails since it won't read a
   password from bash stdin. Also, I couldn't find any cygwin sudo.

   Also, while 'ssh localhost' seems to give me root(0) and
   Administrators (544) group privileges (when running id -a), it
   doesn't give me console access so programs like 'regedit' just
   hang.

   The only solution I have now is to open a new bash window as administrator.
   So is there a way to elevate (or change) privileges from with a bash shell?

2. Is there any better way to determine that one has Administrator
   privileges than to run something like:
   		id -G | grep -Eq '<\544\>'
   Or:
		[[ `id -G` =~$(echo "\<544\>") ]]

	(note the 'echo' is used to get around incompatibilities in
	various versions of bash on how word separators are recognize.)



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

- Raw text -


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