1

I had to copy manually my ssh key from a windows system to a headless ubuntu server using scp (because ssh-copy-id isn't a basic command on windows), and I've desactivated password authentication.

When I tested connecting to the same user on the same IP the windows machine (where I set the key up on) is the only one that seems to acknowledge the fact I've set up an ssh-key pair, it just uses a basic password-based ssh connection.

So far I've checked files & filenames to check for spelling errors and nothing seems out of order, no spelling errors, nothing.
(Please note I'm new to ubuntu and using the cmd terminal so you may have to explain things to me)

1 Answer 1

1

From the post Is there an equivalent to ssh-copy-id for Windows?

I quote the answer by Augie Gardner:

After creating your public key, the key should be stored as:

<whatever folder you started in>/.ssh/id_rsa.pub

So use this command:

cat ~/.ssh/id_rsa.pub | ssh [email protected] "cat >> ~/.ssh/authorized_keys"

where user is your username (sometimes root, or whatever you may have set up), and replace 123.45.67.89 with your machine/host/VPS's IP address.

If the directory .ssh is not yet created on the host machine, use this small variation:

cat ~/.ssh/id_rsa.pub | ssh [email protected] "mkdir ~/.ssh; cat >> ~/.ssh/authorized_keys"

You must log in to answer this question.

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