Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

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?
gamenlegend

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