delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/01/28/15:50:00

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
Message-ID: <41FAA56C.9040508@buddydog.org>
Date: Fri, 28 Jan 2005 15:49:48 -0500
From: Jonathan Arnold <jdarnold AT buddydog DOT org>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8b) Gecko/20050119 MultiZilla/1.6.4.0b
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: su alternative for Win2k
X-IsSubscribed: yes

I was just installing postgreSQL and ran across the problem with
getting initdb to run as the postgres user. As expected, I could
neither su nor login to work. Searching the archives and the like
for a fix, the most often specified one was to use ssh.  But as I
don't run sshd, and it seems a shame to have to run this just to
get an su-like behaviour, that wouldn't work for me.

I finally hit upon the following solution.  Maybe its in the archives,
maybe not, but I thought I would post it (again?) to maybe save someone
the hour or so I spent thrashing around the problem.

1] Create a shortcut to bash on your desktop

2] Now right-click on it and select Properties

3] Select the Shortcut tab and append the '-l' (that's dash el) to the
Target: to make it be a login shell

4] a] Win2k : Select the "Run as different user" check box
    b] WinXP : click on the Advanced button and check "Run with
       different credentials"

Now when you click this shortcut, you will be prompted for the user to
run bash as.  Type in postgres and the password, and voila - you have a
bash shell running as the selected user. Make running initdb and, just
as importantly, createuser a piece of cake.  Assuming, of course, you have
the paths correct.

-- 
Jonathan Arnold     (mailto:jdarnold AT buddydog DOT org)
Amazing Developments       http://www.buddydog.org

I feel like a fugitive from the law of averages. -
  William H. Mauldin


--
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