https://github.com/prhost/docker-ssh-exec-command
Run ssh via command
https://github.com/prhost/docker-ssh-exec-command
Last synced: 3 months ago
JSON representation
Run ssh via command
- Host: GitHub
- URL: https://github.com/prhost/docker-ssh-exec-command
- Owner: prhost
- License: mit
- Created: 2016-08-21T15:07:29.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-08-22T13:01:36.000Z (almost 9 years ago)
- Last Synced: 2025-01-15T13:07:06.680Z (5 months ago)
- Language: Shell
- Size: 11.7 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SSH EXEC COMMAND
Run commands remotely via ssh.
[Docker Hub](https://hub.docker.com/r/prhost/ssh-exec-command/)
`docker pull prhost/ssh-exec-command`
`SSHEXEC_HOST` = host server (required)
`SSHEXEC_PRIVATE_KEY` = private sshkey access (required)
`SSHEXEC_USERNAME` username (default user root)
`SSHEXEC_PORT` = (default port 22)
`SSHEXEC_SCRIPT` = shell command to be executed (required)
```
docker run --rm \
-e SSHEXEC_HOST=example.com \
-e SSHEXEC_PRIVATE_KEY="$(< ~/.ssh/id_rsa.key)" \
-e SSHEXEC_USERNAME=username \
-e SSHEXEC_PORT=22 \
-e SSHEXEC_SCRIPT="ls -la" \
prhost/ssh-exec-command
```