Skip to content

Instantly share code, notes, and snippets.

@ThePredators

ThePredators/readme.md

Last active May 7, 2021
Embed
What would you like to do?

🔥 SSH (CheatSheet)

SSHPass is a tiny utility, which allows you to provide the ssh password without using the prompt. This will very helpful for scripting. SSHPass is not good to use in multi-user environment. If you use SSHPass on your development machine, it don't do anything evil.

Installing on Ubuntu

apt-get install sshpass

Installing on macOS

brew install esolitos/ipa/sshpass

How to use ?

sshpass -p PASSWORD ssh USER@HOST

Using with rsync ?

sshpass -p PASSWORD rsync -Pa ORIGIN_FILE USER@HOST:DEST_FOLDER

Using concurency with rsync ?

sshpass -p PASSWORD xargs -n1 -P4 -I ORIGIN_FILE rsync -Pa ORIGIN_FILE USER@HOST:DEST_FOLDER
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment