I've set up an automated sftp process using powershell.
However, I am wanting to use a public key so I don't have to supply the username and password.
On Unix I can do this fine.
1. Login to unix box (1).
2. Sudo into user "A".
3. Copied over user A's id_rsa.pub information to unix box (2)'s allowed_hosts file.
4. As user 'A', run sftp 'B'@box 2.
Passwordless login works fine.
How do I incorporate this into powershell?
I have the .pub file, but am unsure how to load it or if this would work, seeing as how I must first sudo into user 'A', before I can initiate the session to the share as user 'B'.