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?
31 Answer
Create a symlink:
sudo ln -s /snap/bin/docker /usr/bin/dockerYou 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
PATHon the server in~/.ssh/environment(needs to be enabled byPermitUserEnvironment yesinsshd_config).