File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -46,6 +46,14 @@ Or supply a custom private key:
4646docker 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
5159Options for scanning may be provided as environment variables:
Original file line number Diff line number Diff line change @@ -46,9 +46,15 @@ if [[ ! -z $KNOWN_HOST ]]; then
4646 ssh-keyscan -H -p${KNOWN_PORT:- 22} $KNOWN_HOST >> ~ /.ssh/known_hosts
4747fi
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
5359echo
5460echo " π Bye" | lolcat
You canβt perform that action at this time.
0 commit comments