wallix / awless

A Mighty CLI for AWS
http://awless.io/
Apache License 2.0
4.97k stars 263 forks source link

Support for Windows 10 OpenSSH #241

Closed davidski closed 11 months ago

davidski commented 5 years ago

Is it possible for awless ssh to support the OpenSSH client in current editions of Windows 10?

The current v0.1.11 builds fail to connect with the following output:

C:\> awless ssh -e davidski@REDACTED -i REDACTED.pem
[verbose] awless v0.1.11 - loading AWS session with profile 'default' and region 'us-west-2'
[extra]   dialed REDACTED:22 successfully with user davidski
[info]    Login as 'davidski' on 'REDACTED'; client 'C:\WINDOWS\System32\OpenSSH\ssh.exe'
[extra]   running locally [C:\WINDOWS\System32\OpenSSH\ssh.exe -i C:\Users\davidski\.ssh\REDACTED.pem davidski@REDACTED]
[error]   not supported by windows

It looks like the xanzy/ssh-agent component only supports pagent on Windows and not the OpenSSH agent service. Running the command output from --print-cli works seamlessly, so I'm hoping this can be worked around.

ljluestc commented 11 months ago

It appears that you want a complete and updated script to run the SSH command on Windows using the OpenSSH client. Here's the script:

@echo off

REM Replace these values with your actual paths and connection details
set private_key_path=C:\path\to\REDACTED.pem
set username=davidski
set hostname=REDACTED

REM Run the SSH command
"C:\Windows\System32\OpenSSH\ssh.exe" -i "%private_key_path%" %username%@%hostname%

Save the above script as a .bat file (for example, ssh_to_remote.bat) and replace the placeholders (C:\path\to\REDACTED.pem, davidski, REDACTED) with your actual paths and connection details.

davidski commented 11 months ago

Thanks! I'm not using Windows or awless anymore, but this looks like a nice solution. Closing this out (I didn't realize this was still open)