LTS 22 - using sshpass

Robert Moskowitz rgm at htt-consult.com
Thu May 29 20:48:17 UTC 2025


Well, I found out that really my problem was for some reason I was being 
prompted for fingerprint check and via sshpass this caused ssh to fail!

I did ssh by itself, accepted the password, then tried first your 
format, then mine and it works.

So FIRST make sure you have the servers' fingerprint in your known-hosts!

:)

On 5/29/25 3:37 PM, Peter Flynn wrote:
> On 29/05/2025 18:55, Robert Moskowitz via ubuntu-users wrote:
>> I have a system that I need to automate an rsync transfer to.  This 
>> system only supports userid/password SSH connections.  So I installed 
>> sshpass and tried:
>>
>> sshpass -pmypasswd ssh -p 1234 -4 me at myserver.domain
>>
>> this runs and goes right back to the command prompt.   Does not seem 
>> do anything.
> I was given this syntax:
>
>     sshpass -f <(printf '%s\n' PASSWORD) ssh/scp/sftp/etc...
>
> where PASSWORD is your unquoted password.
>
> Peter
>




More information about the ubuntu-users mailing list