New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
For those who can't get public key authentication working #32
Comments
I can't get SSH key working ( tried installing v0.14 and v0.13) Running Magisk 24.1 and Android 10 Error when i try to login: I am positive the key is working since the same key is working on my old phone star2lte:/data/ssh/root/.ssh # ls -al |
Which key did you copy to your phone? the public key or the private key? |
@ReMiOS Oh and you shouldn't directly copy the key to your phone. The key contents should be copied, and then inside your phone you create the file named authorized_keys and paste what you copied from your public key, to inside the file in your phone. |
Found it ! I noticed i can login when i hop from a linux server to my phone ( added that ssh key too ) So it had to be something with the SSH client. I've upgraded my MobaXterm SSH client from v20.3 to v21.5 and now i can login directly as well Probably due to the upgraded OpenSSL / OpenSSH |
I had to do this: and it works with Putty. Unfortunately it does not work with MobaXterm 21.2. |
First generate a key pair using ssh-keygen
Get the public key (assuming it's named id_rsa.pub) from your computer (in $HOME/.ssh/ folder assuming you are on Linux), to your phone.
Copy the contents of your public key inside your phone using root browser's text editor or any other text editor of your choice.
Create a file named authorized_keys inside the /data/ssh/root/.ssh/ folder.
Paste the contents of your public key into the authorized_keys file using the text editor of your choice.
Copy that file into the /data/ssh/shell/.ssh/ folder if you want shell login too.
Now to login into your phone using ssh, you need the private key (assuming it is named id_rsa) that was generated with your public key. Type this command onto your computer in the same folder as your private key file.
ssh -i id_rsa root@[_your phone's local ip_]
. You don't need to type the-i id_rsa
if you private and public key file is in your computer's $HOME/.ssh/ folder.You got yourself a perfectly functioning key with right permissions! (Unless you didn't follow the instructions correctly)
The text was updated successfully, but these errors were encountered: