Urgent.News

What's breaking now, across thousands of outlets.

Tech

Install an SSH Public Key on a Server from Linux, macOS, or Windows

Password prompts on every SSH connection get old quickly. Public-key authentication fixes that, but first the server needs your public key in the right place. On Linux, ssh-copy-id handles the common case. On macOS and Windows, you may need to install or use an alternative. Before copying a key You need a key pair and a way to log in to the server already, such as a password or another working…

Adding an SSH public key to a server streamlines future logins. Public-key authentication means no more typing passwords, but it requires installing the key first. Linux users can rely on ssh-copy-id for the usual case. On macOS and Windows, alternative methods are needed. Before copying a key, you must have a key pair and an existing way to log in, like a password or another key.

Generating an Ed25519 key pair with ssh-keygen is how you start. The public key ends in .pub, while the private key doesn't. Only the public key should be copied, not the private key contents. On Linux, ssh-copy-id is used to append the public key to the authorized_keys file on a remote account. Specifying the public key explicitly avoids installing the wrong identity.

On macOS, ssh-copy-id isn't built-in, but it can be installed via Homebrew. Alternatively, the public key can be copied to the clipboard using pbcopy. On Windows, PowerShell commands can pipe the public key to the remote server. After copying the key, testing the new connection is crucial. A second terminal session with ssh user@host confirms the installation worked.

If password login is disabled, alternative methods must be used to install the key, such as accessing the server's console or adding the key through the provider's interface when initially creating the instance.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

111 and 2049: RPC and NFS Endpoints in an Internet-Facing Population

111 and 2049: RPC and NFS Endpoints in an Internet-Facing Population Services that were never meant to leave the data centre Some protocols exist to make a private network work.

  • RPC and NFS endpoints found on internet-facing assets
  • Redis and memcached caches accept unauthenticated connections
  • Recommendation to verify reachability and enforce authentication

I have completely abandoned MicroFeed.

Github因为我发的一些比基尼的图片直接给我删库了,其实用的也不是GitHub的图床了还是被废了。虽然GitHub/GitLab注册很简单,但对这些第三方代码平台有点烦了。 SaaS全托管的最后考虑Mataroa…

More from Tuesday 6 October →