ssh - Passphrase Key-based authenication with net-sftp in Ruby -


based on question key based authenication net-sftp in ruby, can sftp key-based authentication using following:

net::sftp.start(host, "user", keys:['~/.ssh/my_key']) |sftp|    sftp.upload! "/local/file.tgz", "/remote/file.tgz" end 

but can't work keys require passphrase -- prompted user login on host. missing pass in let me enter passphrase key? or need stick ssh-agent this?

there's passphrase option:

the passphrase use when loading private key (default nil, no passphrase)

if not specify passphrase, should asked one, unless used non_interactive option:

set true if app non interactive , prefers authentication failure vs password prompt

non interactive applications should set true prefer failing password/etc auth methods vs asking password