title: how to run docker commands in remote machine via jenkins and SSH?
body: <p>I am new to jenkins and I am trying to execute docker command on ubuntu 18.04 Live Server. I've installed docker on it and able to run docker command via ssh.
  Now what i need is to run the same command on server through Jenkins.
  I've jenkins installed on my local ubuntu 20.04 desktop machine. I also have install docker on it.
  When i try to run any command over SSH from jenkins, its working but when i try to run docker command (docker -v), its say</p>
  <p>[SSH] executing...
  bash: line 1: docker: command not found</p>
  <p>i use echo $USER and get that jenkins user is trying to run the command
  but i've not installed jenkins on remote server and there is no user name jenkins on server, so might be its not able to  run</p>
  <p>Then i've created a jenkns user (sudo useradd -s /sbin/nologin jenkins)  on remote server and add it in docker group (sudo useradd -aG docker jenkins) but its still not working.
  what im doing wrong!
  or is there any other better way instead of SSH to run docker container on remote server using jenkins that is installed on different machine.
  or do i need to install jenkins on remote server?</p>
  <p>i solved by using command</p>
  <pre><code>sudo ln -s /snap/bin/docker /usr/bin/docker
  </code></pre>