Skip to content

Instantly share code, notes, and snippets.

@haeramkeem
Last active April 26, 2022 02:50
Show Gist options
  • Save haeramkeem/4fc91c93e11f373ebdaa32e51b5a34e0 to your computer and use it in GitHub Desktop.
Save haeramkeem/4fc91c93e11f373ebdaa32e51b5a34e0 to your computer and use it in GitHub Desktop.
ssh scp sshpass examples
#!/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