SSH Server user authentication - No Password

0 votes
asked Mar 20 by sabiggs (150 points)

Hi,

The client that is connecting is old and does not have support for a password :(

I'm using a modified version of the file server example shown here: https://www.rebex.net/file-server.

I want to add 1 user that uses a username - no password.

I've tried adding:

server.Settings.AllowedAuthenticationMethods = AuthenticationMethods.None;

// register authentication event handler
server.Authentication += (sender, e) =>
{
if (e.UserName.Equals("user01"))
{
e.Accept(new FileServerUser(e.UserName, null));
}
else
{
e.Reject();
}
};

but this does not work and an error is generated:

Disconnected: No supported authentication methods available (server sent:)

The current private key being used does not have a passphrase implemented.

Can you suggest any solution or method to get this working?

Thanks in advance

1 Answer

0 votes
answered Mar 20 by Lukas Pokorny (109,670 points)
selected Mar 23 by sabiggs
 
Best answer

Hi, what exactly does it mean that the client does not have support for a password? Does it mean it's issuing a "none" authentication request that should get accepted based only on the user name? Unfortunately, such scenario is not currently supported by Rebex File Server, but it seems it would be simple to add. If this is what you need, please let us know, chances are we will have a working beta soon.

commented Mar 20 by sabiggs (150 points)
Hi Lukas,

That's pretty much it. The main part of client application does not have any password options and seems to be reliant on the username after the connection is made.  

But, sub system of this application can issues a public key. Is there any sample code i can use which allow users to connect strictly by keys and does not prompt for a password? Again the private key does not have any passphrase.

I did try this:

https://www.rebex.net/file-server/features/authentication.aspx#public-key

but could not get it to work,

Regards,
commented Mar 20 by sabiggs (150 points)
Hi Lukas,

Forget about the public key part of the question. I made the mistake of not loading the private key correctly at the server end, it's all working correctly now,
commented Mar 23 by Lukas Pokorny (109,670 points)
OK, thanks for letting us know! I think we will add support for "none" authentication as well, mostly for the sake of completeness.
...