I've been trying to get out of this, but my manager wont budge.
He wants to sftp files from a server while passing the password in the script. I have said we need to use keys...he said no.
I asked if we had expect capability...no.
He said "use -b batch file command"
I have checked every thread and search and asked several people. I can't find a way to do this is sftp or ssh.
There is a file containing the password in txt.
Is this even possible?
"interactive password authentication" means "password typed by a human being in realtime authentication", and no substitutes for humans are acceptable to it. It makes sure it reads from a terminal, not a file, not a pipe.
To force it to accept a stored plaintext password, you would have to install a third-party brute forcing utility like expect or the like, which creates virtual terminals to fool things into thinking they're interactive when they're not. It would make your scripts a great deal more complicated since you must lead it step by step.