The sshpass command allows you to automate password entry for commands (like ssh) by providing the password through several different methods. By default, if no password option is provided, sshpass will attempt to read the password from stdin.
# Use a password from a file
sshpass -f /path/to/password.txt ssh user@host
# Use a password from an environment variable (SSHPASS)
export SSHPASS='mypassword'
sshpass -e ssh user@host
# Provide password directly as an argument (not recommended for security)
sshpass -p 'mypassword' ssh user@host
# Use a file descriptor for the password
sshpass -d 3 ssh user@host
# Default: read from stdin
echo 'mypassword' | sshpass ssh user@host