snowflake icon indicating copy to clipboard operation
snowflake copied to clipboard

Why do i need a Username when i use a SSH Key to connect?

Open Skyrant opened this issue 4 years ago • 9 comments

If i use a keyfile i should not need a username. Makes absolutely no sense to insist of having a username and then asking for a password. I use keyfiles to not use normal authentication. Other SSH clients i use do not need this.

java.lang.Exception: User name is not present

If i put in a username it will ask me for a password. Baffled to say the least.

Skyrant avatar May 09 '20 22:05 Skyrant

If you use a key file, you have to provide it in session dialog. SSH keys do not contain user information, so they needs to be provided as well.

Also which SSH clients do you use, that supports this by default, we can also try to implement something similar

subhra74 avatar May 10 '20 10:05 subhra74

Mainly SecureCRT from VanDyke for the last 20 years. I was trying your client as it had interesting additional features.

Skyrant avatar May 10 '20 13:05 Skyrant

As you can see here, it allows you to enable and disable auth methods and also change the order in which they are used. Same for the encryption.

image

Skyrant avatar May 10 '20 13:05 Skyrant

You can provide the key file as mentioned: (also provide the user name as well, SecureCRT, you have provided the user name as root) image

subhra74 avatar May 10 '20 14:05 subhra74

I have issues with private key file. I specified key file that works well with Filezilla and terminal ssh client but snowflake cannot connect with this key. I do not know why. How to see logs?

salos1982 avatar May 13 '20 08:05 salos1982

If you are using ed25519 keys then it would not work with current version. New version with support for more key formats will be released soon.

subhra74 avatar May 14 '20 18:05 subhra74

You can provide the key file as mentioned: (also provide the user name as well, SecureCRT, you have provided the user name as root) image

The problem is that the software will ask for a password if i give a username and a key. I don't want to use a password when i pprovided a key.

Skyrant avatar May 31 '20 05:05 Skyrant

@Skyrant All SSH clients can (and normally do) fall back to password auth if key auth fails. Key auth is failing because of bug #50.

Roy-Orbison avatar Aug 09 '20 00:08 Roy-Orbison

For clarity, private key authentication always requires a username. As subhra74 mentioned, key files don't contain user information. If no username is provided there is no way for the server to know which public key to reference.

And as Roy-Orbison mentioned, a password prompt is generated because the key authentication is silently failing due to bug #50 where OpenSSH format private keys are not supported in snowflake, only RSA. See my comment in that thread for how to convert from OpenSSH to RSA. https://github.com/subhra74/snowflake/issues/50#issuecomment-714908817

The real issue here is that the user is not given enough information to understand why they're being prompted for a password when they've included a private key. I recommend adding more verbosity to the prompt, ie 'Server refused our key. Try your password:'

kdubdev avatar Oct 23 '20 05:10 kdubdev