How to enter password automatically in .command So my .command file looks like this

ssh someuser@someip.com


When I run just this it prompts me for the password, how do I make terminal enter the password instead of me having to type it in?  I have tried this:

ssh someuser@someip.com
password


But that does not work.
You could store ssh keys or store your password in the ~/.ssh/config file (see man ssh_config for details) but that would be kind of cheating since it's not really in your .command file.

You could of course script the addition (and optionally removal) of the entries needed to modify ssh keys or config file changes.

I would make a simple expect script - to wait for the password prompt and then enter your password.

#!/usr/bin/expect -f
set bad_idea cleartext_passwords_are_insecure
set timeout -1
# now connect using ssh
spawn ssh user@example.com
expect "*?assword:*"
send -- "$bad_idea\r"
send -- "\r"
expect elf


You don't have use a $bad_idea variable and could just send the password before the \r