> ## Content Index
> Fetch the complete content index at: https://sloanelybutsurely.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Using ssh-copy-id with the 1Password SSH agent
- URL: https://sloanelybutsurely.com/using-ssh-copy-id-with-the-1password-ssh-agent/
- Published: 2026-05-26T19:15:00.000Z
- Updated: 2026-11-29T20:15:18.000Z
- Author: Sloane Perrault

The [SSH agent](https://www.1password.dev/ssh/agent?ref=sloanelybutsurely.com) is one of 1Password’s best features but using it obfuscates things a bit more than I am used to with just files in `~/.ssh/*.pub`. In particular I was used to being able to `scp` my public key onto my servers. I was tempted to see if I could get my public key out of the ssh-agent and pipe it into `ssh` but then I thought “surely there’s a better way…”

And there is! [ssh-copy-id](https://man.freebsd.org/cgi/man.cgi?query=ssh-copy-id&apropos=0&sektion=0&manpath=FreeBSD+15.0-RELEASE&format=ascii&ref=sloanelybutsurely.com) does exactly what I want. All you have to do is make sure you have `SSH_AUTH_SOCK` set.

`ssh-copy-id` will copy to the target all of the keys currently loaded in the agent. If you don’t want to include everything you might want to consider updating your [agent config file](https://www.1password.dev/ssh/agent/config?ref=sloanelybutsurely.com) to only include the key(s) you want.

Here’s how this looks in practice:

```
# list keys currently in the agent
ssh-add -l

# dry run copying the key(s)
ssh-copy-id -l -n user@host

# copy keys
ssh-copy-id -l user@host
```