Re: Is this expected ssh behavior?
In article <[🔎] 87k94vav3y.fsf@nevermore.csres.utexas.edu>,
Rob Browning <rlb@cs.utexas.edu> wrote:
>So it looks like ssh on a Debian system's running bash with something
>like "--noprofile", and the -i doesn't get /etc/profile, just your ~
>scripts. If that's what's happening, is that what we want?
Well for a non-interactive shell you really never ever want to run
/etc/profile or ~/.bash_profile. That is for interactive shells only.
On some of our systems, /etc/profile asks for your terminal type
for example. And indeed, if bash is _not_ a login shell it will not
source those scripts. Don't change that.
An non-interactive bash will also _not_ source ~/.bashrc. However,
from bash(1);
Bash attempts to determine when it is being run by the
remote shell daemon, usually rshd. If bash determines it
is being run by rshd, it reads and executes commands from
~/.bashrc, if that file exists and is readable. It will
not do this if invoked as sh. The --norc option may be
used to inhibit this behavior, and the --rcfile option may
be used to force another file to be read, but rshd does
not generally invoke the shell with those options or allow
them to be specified.
Mike.
--
Miquel van Smoorenburg | Our vision is to speed up time,
miquels@cistron.nl | eventually eliminating it. <*>
--
To UNSUBSCRIBE, email to debian-devel-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Reply to: