M HYPE SPLASH
// news

bash: docker: command not found

By John Campbell

I'm accessing Ubuntu 19.10 running as a virtual machine. In the installation process I installed Docker (as a snap). Everything is fine when I log in using SSH, but this will fail:

$ ssh user@host 'docker info'

returning: bash: docker: command not found. Other commands like $ ssh user@host date or $ ssh user@host 'ls -l' woks fine.

Any suggestions?

3

1 Answer

Create a symlink:

sudo ln -s /snap/bin/docker /usr/bin/docker

You could also check what your path variable shows using the same command, but instead of ls -l use echo $PATH command. You could try to place symlinks to PATH mentioned there.

Set the PATH on the server in ~/.ssh/environment (needs to be enabled by PermitUserEnvironment yes in sshd_config).

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy