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:mime-version:references:in-reply-to:from:date :message-id:subject:to:content-type; q=dns; s=default; b=VFUwGd6 YqTGpNBhEYrLL9sAr8WeDq2L6ldl0tKpTjYj6z8yPBg2nxONZZqdyHQwN8KRPnAX vVR3x+m90+h9nZ9hkeMwG+Yr4tMgq+KbFi/jXG4bIBAzK9N6cxIePsfpHwbvt2Uo hEdOm0yw1UR87t9zTwSLrNjv9yFgVGoLSo4Y= 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:mime-version:references:in-reply-to:from:date :message-id:subject:to:content-type; s=default; bh=9ubhvWnuHpYPA A2g702QY+Aqfqo=; b=KSLP33KSsz2skt6UkfeSCNWFOxt1V266L08QrzJY8woe8 lVL0kqp34hRCPnZwhBhtSt/9iUgbhPkBmQFur+uW0vt9Pci4wfQ30m7LUGC4wdof TIR203zCVotqsrgT2ZJzF3emgHypnCmACZaZ0Pyks+jVnicmgN4aduU9Y2BFBs= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: 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 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-0.4 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=2003, absolutely, switched, Nov X-HELO: mail-wr1-f51.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=gqAyVnJpAei+lHg+UsAjTAB+CVj60k/YWTZ3J1O710s=; b=KAqaeYfRfoi6dFmzlqwLayvy+r1MHqxYFrGyk683H8vsnkY/5Y79OKrKewemoJdiXi saHxPvlnSWQxy+MeRYxkZOJc/EYis1LCzCmnGru2/sTOcdtHEWwSJEoxgARinCRIgTdn c6IGcmtdjQPECpzlKGNqmE68/ngfgmaWOPN6TnUjuQkS1BW+DUtkWauZiH3FEF4ZFYm/ zBNbJ+xtOwnsMZFBEzHZWvBoPLBqs1z6dfbNA+EEGIrBI+64oJtVTvEERa30m/xTbvsw mSmDml/NVJpgCP1BGZW+P9uKv28/l56MLDLpC0sCFCTKOIJKj/mV8EJ6jP4HCER4sUh4 O3eA== MIME-Version: 1.0 References: <17b2ff99-3c08-e1c6-2006-40b6465d94f9 AT t-online DOT de> In-Reply-To: <17b2ff99-3c08-e1c6-2006-40b6465d94f9@t-online.de> From: Erik Soderquist Date: Wed, 8 May 2019 10:33:21 -0400 Message-ID: Subject: Re: How to become root/root (0/0) To: cygwin Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes On Wed, May 8, 2019 at 9:50 AM Henning wrote: > > In order to not be misunderstood: the question is not about executing > a single command as a priviledged user. > > Instead, I'm asking how to get rid the annoying Unknown+User and > Unknown+Group with six digits IDs permanently. This indicates user lookup is not working for some reason; did you configure and start the cygserver service? https://cygwin.com/cygwin-ug-net/ntsec.html > What I've tried so far: > > 1. put USER=root and HOME=/root > This gave me only /root as $HOME. > > 2. put the USER=root and UID=0 on the starting cmdline like so > U:\bin\mintty.exe -d -T tty1 -i /Cygwin-Terminal.ico /bin/env TTY=1 > USER=root UID=0 /bin/bash -il > which gave me $UID=0 but not $USER=root > > 3. additionally set USER=root in ~/.profile > this finally yielded $USER=root I think you are conflating things... On Windows, UID 0 does not exist, and so trying to force UID 0 I would expect to result in less than guest privileges. > _but_ to no avail. because echo foo > bar and then ls -{l,n} showed > that absolutely nothing had changed: USER=Unknown+User (-1) etc. > And, what's worse, an attempt to chmod user perms of ./bar was not > possible. > > 4. following an old thread (Nov 2003) in the cygwin-apps mailing list > I created /etc/passwd with the line > root::0:0:me:/root:/bin/bash > > but again, to no avail. I simply can't get rid of the Unknowen+User > stuff. (And I am unable to change the user bits of permissions.) Except for relatively rare corner cases, the use of /etc/passwd in Cygwin has been deprecated for a long time now. This might actually be causing you significant problems now if you are not one of the rare corner cases. https://cygwin.com/cygwin-ug-net/ntsec.html > I forgot to mention that my Windows user name is root, and I am the > only user, that is, administrator, group administrators. And I have > switched off UAC (registry) in order to avoid constant annoyances > regarding permissions. I certainly understand the feeling here; what I do instead of disabling UAC is configure sshd and alias 'sudo' to 'ssh localhost'; this way I am not always running everything with the admin tokens. > What do I have to do, to get root (user and group). again, conflating; UID/GID 0 does not exist; the nearest equivalent is running the process(es) with the admin tokens in place. Trying to force UID/GID 0 may be what broke this in your environment. > N.B. My cygwin installation is up to date. Windows 8.1 > I have been using Linux for nearly 25 years (since kernel 1.2/3) and > cygwin since 2002. So this is not my first cygwin experience, but my > worst up to now. I reference https://cygwin.com/cygwin-ug-net/ntsec.html specifically because you specify your cygwin install is up to date, but you are using the deprecated /etc/passwd etc. files. -- Erik -- 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