Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • I'm still far from understanding this... Adding point no. (7) to the question. Commented Mar 21, 2016 at 3:45
  • Neither versions of your answer are quite right. SSH always runs a shell, but that shell does not load /etc/profile or ~/.profile if you're running a command rather than starting an interactive session. If the user's login shell is bash and you are running a command, and only on systems where it's enabled (I don't know whether that's the case on OSX), bash loads ~/.bashrc before executing the command (a bizarre complement to the normal use of .bashrc, which is for interactive non-login shells). In all other cases, .bashrc is not loaded when logging in over SSH. Commented Jan 10, 2017 at 22:19