This is a Go language rewrite of the sshpass tool, providing full compatibility with the original version's command-line interface and functionality.
- ✅ Fully compatible command-line options with original sshpass
- ✅ All password input methods (-f, -d, -p, -e, default stdin)
- ✅ Detailed error handling and help information
- ✅ Cross-platform support (Windows, macOS, Linux)
- ✅ No external dependencies (pure Go implementation)
go install github.com/ai-help-me/sshpass@latestsshpass [-f|-d|-p|-e] [-hV] command parameters-f filename- Read password from file-d number- Use specified file descriptor for password-p password- Provide password directly (insecure)-e- Get password from environment variableSSHPASS-P prompt- Set password prompt string (default: password)-v- Verbose output mode-h- Display help information-V- Display version information
sshpass -p mypassword ssh user@hostexport SSHPASS=mypassword
sshpass -e ssh user@hostecho "mypassword" > pass.txt
sshpass -f pass.txt ssh user@hostsshpass -v -p mypassword ssh user@hostsshpass -p mypassword ssh user@host "ls -la"sshpass -p mypassword scp file.txt user@host:/remote/path/This implementation is fully compatible with the original sshpass. All command-line options and behaviors remain consistent, allowing seamless replacement of existing sshpass usage scenarios.
- Providing password directly in command line (-p option) is insecure as it appears in process listing
- Recommended to use file (-f) or environment variable (-e) methods for password input
- Password files should have appropriate permissions (e.g., 600) to protect password security
- Go 1.16 or higher
Same as the original version, licensed under GNU General Public License v2 or later.