Start a new topic

Native OpenSSH support in WIndows

Hi! Microsoft is currently incorporating OpenSSH into Windows. Link: https://arstechnica.com/gadgets/2017/12/microsoft-quietly-snuck-an-ssh-client-and-server-into-the-latest-windows-10/

Let's start using it.


Thanks


1 person likes this idea

Re 1: this would mean that if no credential is provided at all, it will automatically assume the username in %USERNAME% environment variable of the Windows system you are running Royal TS. This means if you have an SSH authentication agent running and the username of the remote system is identical to the username of your client, Royal TS will assume this username automatically. I believe it's the default behavior on *nix systems / open ssh systems.

That should work.

Just tried it, and it isn't covering my scenario.  


This is the scenario closest to what I need.

2) If no password is provided (but a private key file), I will call the API overload which doesn't require the password.


The issue is that I am not specifying a private key in RoyalTS.  I am only supplying the "bitnami" username on the authentication screen.  1Password listens on OpenSSH and provides the key information, externally of RoyalTS.


if a username is supplied and password is not supplied, I want you to call the API overload, regardless of whether a key is specified in RoyalTS.

When username and password and key: 
public void Login(string userName, string password, SshPrivateKey privateKey)


When username and password and no key:

public void Login(string userName, string password)


When username and no password and no key:

public void Login(string userName)



When username and no password and key:

public void Login(string userName, SshPrivateKey privateKey)


Hi Thomas,


I'm afraid that's not possible. The Rebex API doesn't work that way. If I call the API Ssh.Login(username), it will invoke the AuthenticationRequest event to ask for the password:

https://www.rebex.net/doc/api/Rebex.Net.Ssh.Login.html#Rebex_Net_Ssh_Login_System_String_


The only valid call where the username alone can be provided, is the one where an SshAuthenticationAgent is specified:

https://www.rebex.net/doc/api/Rebex.Net.Ssh.Login.html#Rebex_Net_Ssh_Login_System_String_Rebex_Net_SshAuthenticationAgent_


If 1Password can act as an OpenSSH authentication agent which is compatible with the implementation of Rebex, it may work but only if you also specify that a OpenSSH authentication agent should be used:

Did you try that?

Therein lies the problem.  If I specify "OpenSSH Agent", it still requires a username and password, although Rebex doesn't send the password[, or the password is ignored by the server being connected to].  This is what Steve Addison found several days ago.


Using OpenSSH Agent

Specifying a credential with username and a complex password [for some reason a short password wouldn't work], allows for 1Password to trigger and allows logging into the server.


Looks like it is just a quirk that I am going to have to live with.  


Thanks for your time looking into the issue.

Hi Thomas,


I think I found another code path where a username alone could initiate a prompt. I've done some more tests and could improve the behavior in these situations. If you configured an ssh agent, you should now be able to use a connection without a password/key configuration - assuming your agent provides all the missing details.


Regards,
Stefan

One thing that would be lovely is support/integration with the ssh-agent for private keys

The rebex documentation at https://www.rebex.net/doc/api/Rebex.Net.SshAuthenticationAgent.html suggests that SSH agent authentication is ready to use in Rebex. Does this just need exposing within RoyalTS?

Hi Steven,


V7 has SSH Authentication Agent support (no forwarding yet though). You can find the option here:

Version 7?! Why am I only just hearing about this now.


Shut Up And Take My Money Fry Meme Generator - Imgflip

Hi Steve,


the app should tell you, assuming you haven't disabled the update checks. We haven't published a blog post yet as we are still ironing out some minor issues...


cheers,
Stefan

Hi,


I'm not sure what you are asking exactly. OpenSSH for Windows (server and client) are separate components which can be installed and used as application/service. While we do have the possibility to incorporate external applications (for the client) similar to PuTTY, it's not the same as implementing a component with "managed" development APIs, such as Rebex, for example. As far as I know, there are currently no managed API bindings which would make it hard to use in an application such as Royal TS. I'm wondering what you would expect from such an integration or what is missing the current components we're using. Can you elaborate?


Regards,
Stefan

Login or Signup to post a comment