I created a simple bash script that runs fine on Ubuntu 18/20.
Decided to port it onto PowerShell.
I start PowerShell in Windows 10.
Then type: ssh 192.168.1.56
This allows me to reach the target.
(the key is located in /c/users/joe90/.ssh/)
On the other hand, the bash script does the same thing:
#!/bin/bash
ssh 192.168.1.56
Yet, I keep getting this error:
load pubkey "/c/Users/joe90/.ssh/mykey-xyz": invalid format
The only thing I was able to sort out is that typing from PowerShell:
ssh -V
return ==> OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5
But when the myBash.sh bash script runs (/usr/bin/bash ...):
ssh -V
return --> OpenSSH_8.3p1 ...
Any thoughts ?
Additional Notes:
The answer seems to lie here. It does ssh onto target but always leave this error mentioned. I tried to make a public key with no success.
question from:
https://stackoverflow.com/questions/65854109/run-bash-script-in-powershell-with-ssh-fails-with-invalid-format 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…