Skip to content

Commit a0b2ed9

Browse files
committed
✨ Allow copying of files with SCP
1 parent 13540e3 commit a0b2ed9

2 files changed

Lines changed: 17 additions & 3 deletions

File tree

β€ŽREADME.mdβ€Ž

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ Or supply a custom private key:
4646
docker run -e SSH_PRIVATE_KEY="$(cat ~/.ssh/id_ed25519)" --rm -it protomodule/ssh root@localhost
4747
```
4848

49+
### Secure copy
50+
51+
To copy a file with SCP you also need to mount a volume into the container:
52+
53+
```sh
54+
docker run -e SSH_PRIVATE_KEY="$(cat ~/.ssh/id_ed25519)" -v $(pwd):/local --rm protomodule/ssh scp /local/test.txt root@localhost:/tmp/test.txt
55+
```
56+
4957
## Configuration
5058

5159
Options for scanning may be provided as environment variables:

β€Žentrypoint.shβ€Ž

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,15 @@ if [[ ! -z $KNOWN_HOST ]]; then
4646
ssh-keyscan -H -p${KNOWN_PORT:-22} $KNOWN_HOST >> ~/.ssh/known_hosts
4747
fi
4848

49-
echo
50-
echo "πŸ”Œ Starting SSH connection..."
51-
ssh $@
49+
if command -v $1 &> /dev/null; then
50+
echo
51+
echo "🌈 Running command $1 ..." | lolcat
52+
$1 ${@:2}
53+
else
54+
echo
55+
echo "πŸ”Œ Starting SSH connection..."
56+
ssh $@
57+
fi
5258

5359
echo
5460
echo "πŸ‘‹ Bye" | lolcat

0 commit comments

Comments
Β (0)