Last active
April 26, 2022 02:50
-
-
Save haeramkeem/4fc91c93e11f373ebdaa32e51b5a34e0 to your computer and use it in GitHub Desktop.
ssh scp sshpass examples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# ssh example | |
ssh -T -o StrictHostKeyChecking=no ${USERNAME}@${IP} | |
# scp example | |
# Remeber `scp [OPTIONS] [FROM] [TO]` | |
# 1) send | |
scp -T -o StrictHostKeyChecking=no -r ${DIRECTORY} ${USERNAME}@${IP}:${PATH} | |
# 2) receive | |
scp -T -o StrictHostKeyChecking=no -r ${USERNAME}@${IP}:${PATH} ${DIRECTORY} | |
# sshpass synopsis | |
sshpass -p ${PASSWORD} ${[SSH_COMMAND BASH_COMMAND] | SCP_COMMAND} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment