| name | sshpass |
| description | Non-interactive SSH password authentication utility |
sshpass Plugin
Non-interactive SSH password authentication for automated remote operations.
Quickstart
export SSHKEYPASS="your_password"
sshpass -e ssh user@host
sshpass -e scp file.txt user@host:/path/
sshpass -e rsync -avz /src/ user@host:/dst/
sshpass -p "password" ssh user@host "command"
Security Best Practices
- Always use
-e (environment variable) over -p for passwords
- Set
SSHKEYPASS env var instead of passing passwords as CLI args
- For production, prefer SSH key-based authentication
- Never hardcode passwords in scripts or commit them to version control
Common Use Cases
| Command | Description |
|---|
sshpass -e ssh user@host | Interactive SSH session |
sshpass -e ssh user@host "cmd" | Remote command execution |
sshpass -e scp file user@host:/path/ | File copy |
sshpass -e rsync -avz src/ user@host:/dst/ | Directory sync |
Environment Variable
SSHKEYPASS=your_password
Set this env var and use sshpass -e instead of passing passwords on the command line.