ssh hostname cmd isn't loading .bashrc

1

So, I'm trying to run a command from a linux machine on my WSL desktop and the environment is all wrong and thus, the command won't run.

I was under the impression that .bashrc would be loaded if it wasn't an interactive shell, but that obviously isn't the case. Any suggestions?

An example of what I'm trying to do is:

ssh desktop-name scriptname

I have installed python3 using miniconda which should get loaded by .bashrc. However, the script is run by /usr/bin/python which is the default, version two of python on the WSL install and is incompatible with the script. I've also tried env and other simple tests which prove that the environment is not loading any rc files.

The config file (in home) has been removed and I only edited the ubuntu daemon configs to permit remote logs, etc.

user632657

Posted 2019-08-24T18:47:10.370

Reputation: 111

1Please [edit] your question to show exactly how you're invoking this command, what ssh command you're running for example. Include any relevant configuration in your .ssh/config file. – Kenster – 2019-08-24T19:00:00.453

Answers

0

OK, so it was the default .bashrc file itself (in home) that was killing the entire thing.

Apparently, Ubuntu has the following in the file itself which results in the file's commands being ignored:

# If not running interactively, don't do anything                                                        
case $- in                                                                                                  
     *i*) ;;                                                                                                   
     *) return;;                                                                                       
esac    

user632657

Posted 2019-08-24T18:47:10.370

Reputation: 111