1

I installed OpenSSH server on a windows 7 pc, then I tried to use the client using ssh localhost command and it gives me the cmd just fine.

Now on my android I tried to log-in to that server using [email protected] and I entered the passphrase that "ssh-keygen.exe" prompted me when I was trying to make one.

Note: I executed "ssh-keygen" on the dame computer that I installed the ssh server. And I copied the contents of the "key.pub" file to ".ssh/authorized_keys" file.

Now it gives me an Permission Denied error when I try to login with those credentials. And note: The android and the Server PC is on the same network.

2 Answers 2

3

When using SSH Public Key Authentication, every client needs a copy of the private key. Or better yet, their own dedicated private key. Every corresponding public key has its own entry in authorized_keys.

The password you were asked for isn’t for the account, it’s for the private key, which is encrypted.

You’ll have to look into the Android SSH client’s documentation to find out how to use your private key there.

0

As Daniel B. said, the password you entered into ssh-keygen is the password for your private key, not for ssh. Also, you're supposed to generate a key on the client device, and then copy that client's public key into the authorized_keys file. It sounds like you copied the server's public key into the server's authorized_keys list.

Unless you set ssh up to require a public/private key for login, you will not require the public key. If you do have it configured to require an authorized key, you will need to generate a public/private keypair on your Android device and add that public key to the server's authorized_keys.

Long story short, the password it's asking for is most likely the password for the user account you're trying to ssh into (i.e., the password for myusername in your example).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .