# Bash: line xx: xxxxxx: command not found while SSH into Remote

**URL:** <https://discuss.circleci.com/t/bash-line-xx-xxxxxx-command-not-found-while-ssh-into-remote/20548>\
**Category:** Build Environment\
**Created:** [March 7, 2018, 10:08pm UTC](https://discuss.circleci.com/t/bash-line-xx-xxxxxx-command-not-found-while-ssh-into-remote/20548 "2018-03-07T22:08:08Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mdere](https://avatars.discourse-cdn.com/v4/letter/m/82dd89/32.png) [@mdere](https://discuss.circleci.com/u/mdere)\
**Post date:** [March 7, 2018, 10:08pm UTC](https://discuss.circleci.com/t/bash-line-xx-xxxxxx-command-not-found-while-ssh-into-remote/20548/1 "2018-03-07T22:08:08Z")

</div>

So the following output

> /usr/bin/docker  
> /usr/local/bin/docker-machine  
> /usr/local/bin/docker-compose  
> /usr/local/bin/protoc  
> bash: line 23: goenv: command not found  
> bash: line 24: go: command not found  
> bash: line 25: go: command not found

So in my config.yml:

> ```
> ssh -o StrictHostKeyChecking=no -p 3022 tp-dev@71.171.106.102 "
> ...................
> goenv shell 1.9.2;
> go get github.com/micro/protobuf/{proto,protoc-gen-go}
> go get -v github.com/rubenv/sql-migrate/...;
> cd ./project;
> git pull;
> dep ensure;
> make proto;
> make build;
> make run;"
> 
> ```

So in my remote server - ssh’ed in as user and I can run goenv and go after running goenv shell 1.9.2 - but for some reason only through circleci - it wont run.

Still investigating this…but if anyone can point out any mistakes or potential issue with my approach please let me know…Thanks!

---

<div class="post-metadata">

**Author:** ![halfer](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/halfer/32/9083_2.png) [@halfer](https://discuss.circleci.com/u/halfer)\
**Post date:** [March 7, 2018, 10:23pm UTC](https://discuss.circleci.com/t/bash-line-xx-xxxxxx-command-not-found-while-ssh-into-remote/20548/2 "2018-03-07T22:23:06Z")

</div>

I wonder if your `PATH` is different between the two cases? Try amending your unqualified calls above with qualified paths, e.g. `/usr/bin/go` or whatever.

---

<div class="post-metadata">

**Author:** ![mdere](https://avatars.discourse-cdn.com/v4/letter/m/82dd89/32.png) [@mdere](https://discuss.circleci.com/u/mdere)\
**Post date:** [March 7, 2018, 10:25pm UTC](https://discuss.circleci.com/t/bash-line-xx-xxxxxx-command-not-found-while-ssh-into-remote/20548/3 "2018-03-07T22:25:17Z")

</div>

Before I do that - I tried another test to do a “which goenv” and it returns blank, and goenv as remote user exists.

But let me see, if I can do that since goenv manages my go versions

---

<div class="post-metadata">

**Author:** ![mdere](https://avatars.discourse-cdn.com/v4/letter/m/82dd89/32.png) [@mdere](https://discuss.circleci.com/u/mdere)\
**Post date:** [March 7, 2018, 10:32pm UTC](https://discuss.circleci.com/t/bash-line-xx-xxxxxx-command-not-found-while-ssh-into-remote/20548/4 "2018-03-07T22:32:32Z")

</div>

@halfer - so it seems like my ~/.bashrc file isn’t being init’ed when I ssh into the remote through CircleCI - I confirmed it by exporting an env variable then echo’ed it in my command

ssh … “  
echo $GOROOT  
”

It outputted nothing…

To clarify - I even added . ~/.bashrc too in my command

---

<div class="post-metadata">

**Author:** ![mdere](https://avatars.discourse-cdn.com/v4/letter/m/82dd89/32.png) [@mdere](https://discuss.circleci.com/u/mdere)\
**Post date:** [March 7, 2018, 10:46pm UTC](https://discuss.circleci.com/t/bash-line-xx-xxxxxx-command-not-found-while-ssh-into-remote/20548/5 "2018-03-07T22:46:07Z")

</div>

Ok I tried to run my command in my console - and it’s replicate-able, so my question is why doing

A. ssh … “  
commands;  
”

vs

B. ssh …  
then terminal in

What … well why doesn’t A load my bashrc?

---

<div class="post-metadata">

**Author:** ![mdere](https://avatars.discourse-cdn.com/v4/letter/m/82dd89/32.png) [@mdere](https://discuss.circleci.com/u/mdere)\
**Post date:** [March 7, 2018, 11:08pm UTC](https://discuss.circleci.com/t/bash-line-xx-xxxxxx-command-not-found-while-ssh-into-remote/20548/6 "2018-03-07T23:08:14Z")

</div>

Actually the question I want to ask now is there a more programatical way of doing large scale ssh command line upon deploy? Or circleci only supports

> |  
> ssh … "  
> commands  
> "

---

<div class="post-metadata">

**Author:** ![mdere](https://avatars.discourse-cdn.com/v4/letter/m/82dd89/32.png) [@mdere](https://discuss.circleci.com/u/mdere)\
**Post date:** [March 8, 2018, 1:42am UTC](https://discuss.circleci.com/t/bash-line-xx-xxxxxx-command-not-found-while-ssh-into-remote/20548/7 "2018-03-08T01:42:23Z")

</div>

Ok the issue was that Linux OS’s references their bash profile differently - in my case I was using Ubuntu and I put my info into /etc/bash.bashrc at the top. So if you have a global export of directories and initiations - I put my stuff there and everything works now. Someone with more Linux background please provide more input and clarity or suggestions of where should one put their profile so it will be globally provided to all user

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/circleci/original/3X/5/1/511608acda8e85906e15909b57bd0a46c1dbe291.png) [@system](https://discuss.circleci.com/u/system)\
**Post date:** [June 18, 2018, 11:32am UTC](https://discuss.circleci.com/t/bash-line-xx-xxxxxx-command-not-found-while-ssh-into-remote/20548/8 "2018-06-18T11:32:52Z")

</div>


