Disclaimer : I am absolute noob in terms of SSH kind of stuffs.

I maded a SSH key on ConnectBot app on android.I still have password of that key.I got a private and public key.I shared public key with tildes for making accounts.Now they know me by my that key but I want to login by termux. On termux I installed openssh and tried to login it says that authentication failed.

So I just need to backup keys from connected bot and restore on termux and my PC . Will it work ? How to do it? Will making a new pair of keys using same pass and name will work?

I did not got anything regarding this on searches

  • SwingingTheLamp@midwest.social
    ·
    10 months ago

    According to the ConnectBot issue tracker, it's not possible to retrieve the private key that it created. You'll have to make a new key pair, and share the new public key with tildes. The keys are randomly-generated, so the new pair will be different, regardless of whether you use the same password.

  • bloubz@lemmygrad.ml
    ·
    10 months ago

    If you sent a public key for connection, only the private key associated with it will be able to connect. If you regenerate new keys, it doesn't matter what passphrase you use, it will be different keys. Keys are randomly generated and your passphrase does not impact this, it "only" encrypts your private key at rest so that if someone steals it, it cannot be used without the passphrase.

    It is generally advised to create different key pairs for each device and each server to connect to, in this since both termux and connectbot are an your phone you may want to use the same key, or you may generate a new key pair in termux and share the public key again to be authorized to connect with this new private key.

    If you want to reuse your old key, you have to find where it currently is and copy it to ~/.ssh/. I would advise to inform ssh how to connect to your server by editing (or creating) the ~/.ssh/config file (you can find the syntax online). It should mention the key to use to connect to your host.

  • Ghoelian@lemmy.dbzer0.com
    ·
    10 months ago

    I don't know connectbot, but it's probably not putting the keys where openssh is expecting them.

    By default, ssh looks for keys in ~/.ssh/id_rsa(.pub for the public key).

    What I would do is just run ssh-keygen from termux, let it create the .ssh folder and set the correct permissions etc., see where it put that folder, and then just replace the id_rsa files with those from connectbot.