Scripts for waiting mac ssh to come up #104

Closed
opened 2025-12-28 23:24:28 +01:00 by adam · 2 comments
Owner

Originally created by @shifujun on GitHub (Jan 19, 2021).

Just sharing😃

Install sshpass for auto enter password.
sudo yum install sshpass

Make a sshDockerOsx.sh:

sshpass -p docker-osx \
ssh \
  -o UserKnownHostsFile=/dev/null \
  -o StrictHostKeyChecking=no \
  -p 50922 \
  docker-osx@localhost $@

Make a waitForDockerOsx.sh:

until ./sshDockerOsx.sh true; do
  echo "sleep 2 for waiting"
  sleep 2
done
echo "Docker-OSX SSH ready"

After docker run -d .... start up macOs, execute ./waitForDockerOsx.sh && ./sshDockerOsx.sh can auto wait and login macOS.

Originally created by @shifujun on GitHub (Jan 19, 2021). Just sharing😃 Install `sshpass` for auto enter password. `sudo yum install sshpass` Make a `sshDockerOsx.sh`: ``` sshpass -p docker-osx \ ssh \ -o UserKnownHostsFile=/dev/null \ -o StrictHostKeyChecking=no \ -p 50922 \ docker-osx@localhost $@ ``` Make a `waitForDockerOsx.sh`: ``` until ./sshDockerOsx.sh true; do echo "sleep 2 for waiting" sleep 2 done echo "Docker-OSX SSH ready" ``` After `docker run -d ....` start up macOs, execute `./waitForDockerOsx.sh && ./sshDockerOsx.sh` can auto wait and login macOS.
adam closed this issue 2025-12-28 23:24:28 +01:00
Author
Owner

@sickcodes commented on GitHub (Jan 19, 2021):

Perfect! This will work good for version 3, will be using SSH keys however, but the loop is good, thank you 😁!

@sickcodes commented on GitHub (Jan 19, 2021): Perfect! This will work good for version 3, will be using SSH keys however, but the loop is good, thank you 😁!
Author
Owner

@sickcodes commented on GitHub (Jan 24, 2021):

Added here: a09c565e36

@sickcodes commented on GitHub (Jan 24, 2021): Added here: https://github.com/sickcodes/Docker-OSX/commit/a09c565e36d45f6663567b7c4f1402279e725519
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Docker-OSX#104