Use sshpass, one of two forms:
sshpass -ffilename ssh user@ip # prefer thissshpass -pPa5sw0rd ssh user@ip # avoid thiswhere your password is in the first line of the file filename or it is literally Pa5sw0rd. Notes:
- In the manual there is no space after
-por-f, but at leastsshpass1.06 in my Debian 10 allows it; yoursshpassmay or may not. - If your password contains characters your shell will interpret (like
$,'or;) then you should quote it properly in the command line (but not in the file). - Avoid
-p, prefer-f. Usechmod 600 filenameto make the file private (root will still be able to access it though). Read about security considerations in the manual.