Since the sshpass
is a part of the apk
default packages you don’t have to install OpenSSH to get sshpass. Let’s keep it to the simple things and see the best way to install sshpass on Alpine Linux.
Prerequisites
- Alpine Linux
- sudo privileges
Install sshpass on Alpine Linux
Step 1. Let’s update the apk
packages.
sudo apk update
Step 2. Install sshpass.
sudo apk add sshpass
Step 3. Verify the installation.
sshpass -h
Output:
Usage: sshpass [-f|-d|-p|-e] [-hV] command parameters
-f filename Take password to use from file
-d number Use number as file descriptor for getting password
-p password Provide password as argument (security unwise)
-e Password is passed as env-var "SSHPASS"
With no parameters - password will be taken from stdin
-P prompt Which string should sshpass search for to detect a password prompt
-v Be verbose about what you're doing
-h Show help (this screen)
-V Print version information
At most one of -f, -d, -p or -e should be used
Conclusion
Feel free to leave a comment below and if you find this tutorial useful, follow our official channel on Telegram.