Assumptions: remote host is running an older docker version, on Linux, and the user shell is bash.
This script is used to setup a remote docker host running an engine prior to 18.09 to allow remote docker ssh based access. It will upgrade the docker client used by the specific user to 18.09, placing the client binary in $HOME/bin/docker and updating .bashrc to prioritize $HOME/bin over the rest of the path. Once run on the remote host, you can connect to it from another docker 18.09 or newer client over ssh using:
docker -H ssh://host info
or
export DOCKER_HOST=ssh://host
docker info