a-shell icon indicating copy to clipboard operation
a-shell copied to clipboard

Lg2: failed to start SSH session: Failed getting banner

Open HeavySnowJakarta opened this issue 3 years ago • 21 comments

Cloning GitHub repositories via SSH while:

ERROR 23: failed to start SSH session: Failed getting banner
Bad news:
 failed to start SSH session: Failed getting banner

HeavySnowJakarta avatar Mar 19 '23 06:03 HeavySnowJakarta

Hi, It's easier for me to help you on issues if I have a little bit more context: which github repositories are you trying to clone, what's the command, what is the rest of the error message...

What I can tell you is: I can clone github repositories on my machines, so it's not happening every time. I think the first question is: which SSH key are you using to connect to github, and where is it located?

holzschu avatar Mar 19 '23 08:03 holzschu

Hi,

It's easier for me to help you on issues if I have a little bit more context: which github repositories are you trying to clone, what's the command, what is the rest of the error message...

What I can tell you is: I can clone github repositories on my machines, so it's not happening every time.

I think the first question is: which SSH key are you using to connect to github, and where is it located?

It disappeared now and I don't know why. But another problem occurred:

Bad news:
 ERROR: You're using an RSA key with SHA-1, which is no longer allowed. Please use a
 newer client or a different key type.
Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/ fo
r more information.

HeavySnowJakarta avatar Mar 26 '23 03:03 HeavySnowJakarta

Hi, This time, the error message is pretty self-explanatory: you are connecting to github with an old SSH key, which is not secure enough. You need to generate a new key (and upload the public part to github).

holzschu avatar Mar 26 '23 07:03 holzschu

Hi,

This time, the error message is pretty self-explanatory: you are connecting to github with an old SSH key, which is not secure enough. You need to generate a new key (and upload the public part to github).

I regenerated the ssh key, but the problem still exists.

Ver: 1.0.4, build 308, from TestFlight

HeavySnowJakarta avatar Mar 26 '23 08:03 HeavySnowJakarta

The TestFlight version is quite outdated compared to the AppStore version (because Apple takes longer to approve TestFlight version than AppStore versions, weird, I know). I would suggest installing the AppStore version.

You mentionned regenerating the key, but not uploading it to GitHub. Did you do that too?

holzschu avatar Mar 26 '23 08:03 holzschu

The TestFlight version is quite outdated compared to the AppStore version (because Apple takes longer to approve TestFlight version than AppStore versions, weird, I know). I would suggest installing the AppStore version.

You mentionned regenerating the key, but not uploading it to GitHub. Did you do that too?

What a strange thing. I've updated the new key and deleted the old one.

HeavySnowJakarta avatar Mar 26 '23 08:03 HeavySnowJakarta

Still happened in App Store version newly installed, ver 1.11.0. The same output:

Bad news:
 ERROR: You're using an RSA key with SHA-1, which is no longer allowed. Please use a
 newer client or a different key type.
Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/ fo
r more information.

HeavySnowJakarta avatar Mar 26 '23 08:03 HeavySnowJakarta

This very much looks like an issue with your keys and your configuration, not with a-Shell.

  • what is the content of ~/Documents/.ssh? (try ls ~/Documents/.ssh)
  • which keys are present if you go to https://github.com/settings/keys? do they match the ones in ~/Documents/.ssh?
  • are you trying to clone or update a repository? If it's update, is there a .git/config file in that directory?
  • do you have a file in ~/Documents/.gitconfig? What does it say?

holzschu avatar Mar 26 '23 09:03 holzschu

This very much looks like an issue with your keys and your configuration, not with a-Shell.

  • what is the content of ~/Documents/.ssh? (try ls ~/Documents/.ssh)

  • which keys are present if you go to https://github.com/settings/keys? do they match the ones in ~/Documents/.ssh?

  • are you trying to clone or update a repository? If it's update, is there a .git/config file in that directory?

  • do you have a file in ~/Documents/.gitconfig? What does it say?

I think so. If so, I suggest telling the user how to do it on the doc. As you wonder, I tried:

[~/Documents]$ 
[~/Documents]$ ls ~/Documents/.ssh
id_rsa          id_rsa.pub      known_hosts     known_hosts.old
[~/Documents]$ ls .git
ls: .git: No such file or directory
[~/Documents]$ ls -a
.       ..      .pkg    .ssh    bin
[~/Documents]$ 

It seems no configuration files exist.

What I did during the key generation? I typed:

$ ssh-keygen -t rsa -C "my email"

It asked me the file name. I entered.

Then it asked me the password phrase and to retype it. I entered for a key with no password.

Then I deleted the old key on GitHub and uploaded the new one.

Then I tried to test it:

$ ssh -T [email protected]

It asked me nothing but told me authentication passed. Everything worked finely. Then I tried to clone a repository, the output above happened. That's what I did.

HeavySnowJakarta avatar Mar 26 '23 09:03 HeavySnowJakarta

You seem to have done everything right. The output when you are trying to clone a repository should tell you which key you are using. Does it correspond to the key you created?

holzschu avatar Mar 26 '23 09:03 holzschu

You seem to have done everything right.

The output when you are trying to clone a repository should tell you which key you are using. Does it correspond to the key you created?

Ah, here is the detail you may concern:

[~/Documents]$ lg2 clone [email protected]:HeavySnowJakarta/DOSFETCH.git
Cloning into ./DOSFETCH.git
No user.identityFile found in git config: config value 'user.identityFile' was not found.
SSH keys in /var/mobile/Containers/Data/Application/DAD2B727-54C1-4F57-ABC5-B05D65201079/Documents/.ssh/:
 1              id_rsa
Enter the number to the left of the desired key or the path to some other SSH key (the private key).
SSH Key: 1
Password: 
Consider running,
    lg2 config user.identityFile '/var/mobile/Containers/Data/Application/DAD2B727-54C1-4F57-ABC5-B05D6520
1079/Documents/.ssh/id_rsa'
    lg2 config user.password ""
to save this username/password pair.
ERROR 23: ERROR: You're using an RSA key with SHA-1, which is no longer allowed. Please use a newer client
 or a different key type.
Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/ for more information.
Bad news:
 ERROR: You're using an RSA key with SHA-1, which is no longer allowed. Please use a newer client or a dif
ferent key type.
Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/ for more information.

HeavySnowJakarta avatar Mar 26 '23 10:03 HeavySnowJakarta

I removed my .gitconfig file and tried cloning one of my repositories. I had the same questions, except at the end it cloned the repository. So the most likely explanation is that your new key is also using SHA-1. What command did you use to generate it?

holzschu avatar Mar 26 '23 11:03 holzschu

I removed my .gitconfig file and tried cloning one of my repositories. I had the same questions, except at the end it cloned the repository. So the most likely explanation is that your new key is also using SHA-1. What command did you use to generate it?

All commands I typed have been given above. Maybe my account is newer and the policy to me is more restricted?

HeavySnowJakarta avatar Mar 27 '23 05:03 HeavySnowJakarta

You said (yesterday): "I regenerated the ssh key". How did you do that? What command did you issue?

holzschu avatar Mar 27 '23 09:03 holzschu

You said (yesterday): "I regenerated the ssh key". How did you do that? What command did you issue?

That's not complex at all. What I did is just deleting the existing keys and running the commands above.

In fact, I uninstalled the test flight version, reinstalled the App Store version and reconfigured the color and font to ensure everything is brand new.

HeavySnowJakarta avatar Mar 27 '23 11:03 HeavySnowJakarta

I would try with a different type of key. Either ssh-keygen -t rsa-sha2-512 -C "my email" or even ssh-keygen -t ecdsa -C "my email"

holzschu avatar Mar 27 '23 12:03 holzschu

I would try with a different type of key. Either ssh-keygen -t rsa-sha2-512 -C "my email" or even ssh-keygen -t ecdsa -C "my email"

I would too.

HeavySnowJakarta avatar Mar 27 '23 12:03 HeavySnowJakarta

I would try with a different type of key. Either ssh-keygen -t rsa-sha2-512 -C "my email" or even ssh-keygen -t ecdsa -C "my email"

I used ssh-keygen -t rsa-sha2-512 -C "my email", the problem still exists.

HeavySnowJakarta avatar Mar 27 '23 12:03 HeavySnowJakarta

I use ssh-keygen -t ed25519 today and the problem has disappeared. I STRONGLY suggest to have it written in the doc before the problem is completely found out.

HeavySnowJakarta avatar Mar 29 '23 13:03 HeavySnowJakarta

As there is nowhere like "the official document", I sincerely advise that it should have an official document to teach people how-to-dos. Somewhere like iSH wiki here would be great. I may contribute if you like.

HeavySnowJakarta avatar Mar 29 '23 13:03 HeavySnowJakarta

I just had the same problem, although no banner error message, and I just opened a similar issue. Apologies for the quasi-duplicate. And yes @HeavySnowJakarta, the mention that is now in the guide is important (using ed-25519 instead of rsa).

Hullow avatar Aug 31 '23 17:08 Hullow