Opening Session Using Public Key

Advertisement

gamenlegend
Guest

Opening Session Using Public Key

Good day all, I've been searching the forums and main documentation pages and I'm at a loss. However, the amount of documentation already available has helped me get quite far.

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.
Example:
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'.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
28,811
Location:
Prague, Czechia

Re: Opening Session Using Public Key

You seem to mix two things.

Is your question about "Opening Session Using Public Key" from PowerShell? (no need to do sudo for that).
Or about setting up public key authentication automatically using PowerShell?

Reply with quote

Advertisement

You can post new topics in this forum