delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/07/07/15:25:26

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs
Date: Mon, 7 Jul 2003 15:25:07 -0400 (EDT)
From: Igor Pechtchanski <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: Bill McCormick <wpmccormick AT covad DOT net>
cc: cygwin AT cygwin DOT com
Subject: Re: users and startup scripts (FAQ alert)
In-Reply-To: <NDBBLLFMLFMANIDPNADCGECIFBAA.wpmccormick@covad.net>
Message-ID: <Pine.GSO.4.44.0307071514430.23687-100000@slinky.cs.nyu.edu>
Importance: Normal
MIME-Version: 1.0

On Mon, 7 Jul 2003, Bill McCormick wrote:

> My /etc/.bash_profile doesn't seem to get executed. According to
> http://www.gnu.org/manual/bash-2.05a/html_chapter/bashref_6.html#SEC63 it
> wouldn't, which is contrary to other posts I've seen and Cygwin docs. So
> consequently, my bash.bashrc and ~/.bashrc do not get executed.
>
> /etc/profile does execute but where exactly is it called from? Is it called
> from the executable?

According to the "Bash Startup Files" section of the bash info page, bash
looks for either [/etc/profile, ~/.bash_profile|~/.bash_login|~/.profile]
when it's a login shell, and a [~/.bashrc] if it's a non-login shell.
Also from there:

   So, typically, your `~/.bash_profile' contains the line
     `if [ -f ~/.bashrc ]; then . ~/.bashrc; fi'
   after (or before) any login-specific initializations.

Hope this helps.

> On a different topic ...
>
> I ran mkpasswd -l > /etc/passwd and mkgroup -l /etc/group and still cannot
> 'su' or 'login' as a different user from bash. Is there something else that
> needs to be done after that? What is the preferred way to change users (su
> or login) or should both work?
>
> I'm just getting started with cygwin so sorry if I missed the blindingly
> obvious.
> Bill

See <http://cygwin.com/cygwin-ug-net/ntsec.html#NTSEC-SETUID> and
<http://cygwin.com/faq/faq.html#SEC43>.  In short, "su" is not supported
under Cygwin, and "login" won't work by default for any user other than
SYSTEM (aka LocalSystem).

The preferred method for switching users is by running "ssh
user AT localhost" (after setting up sshd, obviously).  I'm guessing the
above FAQ entry should be updated as well.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha AT cs DOT nyu DOT edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor AT watson DOT ibm DOT com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster."  -- Patrick Naughton


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