I am connecting from a UNIX server to a third party server (EFT on client side). EFT supports only dual authentication.
So client has provided us the userid and password and we have shared the public key to them.
My shell script has to push and pull the files from third party.
I don't have expect
, lftp
, curl
, sshpass
in my server, cannot install then either.
How do I pass the password for the sftp
command in the shell script to connect to remote server?
Now I am keying the password manually for the file transfer to happen, which is working.
But need to automate this.
Please advise.
If you really need a password authentication (in addition to the public key authentication), you cannot use vanilla OpenSSH ssh
. It is purposefully built in a way not to allow automating password authentication.
ssh
using tools like expect
and sshpass
:expect
/sshpass
equivalent. Or use your favourite programing language that is available on your server to implement the SFTP: Python/Perl/Ruby/PHP/C/C++. There are SFTP libraries for all of them.