Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

9
  • 3
    On which server? Commented Jun 17, 2014 at 19:47
  • 3
    @Amalgovinus Obviously you run this on the client, not the machine you're connecting to - you don't want a copy of your private key on the server! :) Commented Sep 24, 2014 at 16:09
  • 15
    Please note that generally, allowing remote root logins is not a recommended security practice. Commented Jun 22, 2015 at 18:21
  • 8
    @nevelis: If it was obvious to them, they wouldn't have asked. Some people are new to ssh-keygen and they might not understand where the public and private keys are. That's why they're here. Commented Oct 19, 2021 at 1:47
  • 2
    Just elaborating on this answer: I was reluctant to use ssh-copy-id because I wasn't familiar with it; I've always just copied the .pub file, and when it didn't work, tried debugging it with ssh -v. But today, after half an hour of frustration, I thought what the hell, try using this utility instead. And then it just started working. I had to clear some unwanted keys from authorized_keys on my remote machine, but in the end it saved a lot of hassle. Sometimes the easy way really is better. 😏 Commented Oct 19, 2021 at 1:48