Topic "Opening Session Using Public Key"

Author Message


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.
1. Login to unix box (1).
2. Sudo into user "A".
3. Copied over user A's 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'.
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24736
Location: Prague, Czechia
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?

You can post new topics in this forum

Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License