-
Notifications
You must be signed in to change notification settings - Fork 778
scp through jumphost missbehaves with powershell as shell on target #1347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
How to reproduce. I have a very simple powershell script with scp.exe : scp.exe : The term 'scp.exe' is not recognized as the name of a cmdlet, functio At C:\Users\Administrator\Desktop\remoteEcho.ps1:3 char:1 + & 'C:\Program Files\OpenSSH-Win64\scp.exe' -o "ProxyCommand ssh autom ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (scp.exe : The t...cmdlet, functio:String) [], RemoteException + FullyQualifiedErrorId : NativeCommandError
If I remove the regkey -forcing cmd as shell the script works |
Opps, didn't intend to close |
Is this related to #1172? As of the error PowerShell says, is your |
It might be the same type of issue but it's not the issue of 1172 ( I do use the patched binary and i have also tested from a Linux system with the same error. I do have the following test scenarios: I can log on to them with SSH and I will get powershell as shell so that proves that the regvalue is correct and working As long as you have CMD as shell on Targetserver all scenarios above works- it's only when you have powershell as defaultshell on targetserver it fails so therefore we now that the path is ok else it would fail with CMD as shell too. The path looks ok too. |
I reinstalled the sytem and currently I can't repro anymore ..... |
I made it with: PS> scp -oProxyCommand="$((gcm ssh).path) -W %h:%p jumphost" path\to\src targethost:path/to/dest
|
Please answer the following
**"OpenSSH for Windows" **
version 7.9
Server OperatingSystem
Server 2016
What is failing
scp
Expected output
file copied
Actual output
Powershell error
I have been working on coping files with SCP from my adminserver through a jumphost to a targetsystem. The goal is to copy a script from adminhost to target, execute the script on target and finally scp the result back to admin (this is a workaround untill pssessions have support for jumphosts)
During this testing i found that scp -oProxyCommand="ssh -W %h:%p user@jumphost" c:\myscript.ps1 user@target:\myscript.ps1 will fail if i have defaultshell set to powershell on target.
if i remove hklm.....\defaultshell=....\powershell.exe, ie forcing cmd.exe as default shell it works
The text was updated successfully, but these errors were encountered: