users and startup scripts (FAQ alert)
Igor Pechtchanski
pechtcha@cs.nyu.edu
Mon Jul 7 19:51:00 GMT 2003
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@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@cs.nyu.edu
ZZZzz /,`.-'`' -. ;-;;,_ igor@watson.ibm.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/
More information about the Cygwin
mailing list