Skip to main content
July 4, 2025
Solved

SSH Agent Config File Order is Dependent on File Ending With Extra Newline

  • July 4, 2025
  • 4 replies
  • 133 views

I was very confused as to why I was seeing inconsistent behavior between changes to my `~/.config/1Password/ssh/agent.toml` file until I realized that it depended on whether or not my configuration ended with an extra "/n" character.

Here is an example of a working config:

[[ssh-keys]]
item = "ssh key 1"
vault = "Employee"

[[ssh-keys]]
item = "ssh key 2"
vault = "Private"

[[ssh-keys]]
item = "ssh key 3"
vault = "Engineering"

The results of the command SSH_AUTH_SOCK=~/.1password/agent.sock ssh-add -l are in the correct order:
```
256 SHA256:*** ssh key 1 (ED25519)
256 SHA256:*** ssh key 2 (ED25519)
256 SHA256:*** ssh key 3 (ED25519)
```

However, with one small change to the file:

[[ssh-keys]]
item = "ssh key 1"
vault = "Employee"

[[ssh-keys]]
item = "ssh key 2"
vault = "Private"

[[ssh-keys]]
item = "ssh key 3"
vault = "Engineering"

The parsing reverts to the default output of the command when there is no config file. I think this may have to do with whatever TOML parser not handling files without an extra "\n" ending on the file well.

May be worth a mention on the docs if this is expected behavior. Confused me for quite a while 😅

Best answer by

Hi @bizmyth ,

Thanks for sharing this. This is a bug and we are very thankful you found it!  I don't have a timeline for a fix, but keep your eyes open on https://releases.1password.com/ 

Thanks,
Phil & Team

4 replies

July 7, 2025

Hi @bizmyth ,

Thanks for the note. I'll pass this along internally.

Regards=, ~Phil

floris_1P
1Password Employee
July 10, 2025

Thanks for reporting! That sounds like a bug. Could you check if you see an error reported in the SSH agent settings panel? If it's a TOML file parsing error, you should see an error message displayed there.

 

bizmythAuthor
July 20, 2025

I looked for this, but I didn't see any reported error in the UI.

Here's what it looks like when I cause an intentional error (so I know it is detecting my changes):

Here's what it looks like with the file without a newline character at the end (No `error` in the dialog):

It shows no error, yet it is still parsing the config file incorrectly.

July 18, 2025

Hi @bizmyth ,

Did you happen to get a chance to see if there were errors as @floris_1P mentioned above?

Thanks!

Phil

Answer
July 21, 2025

Hi @bizmyth ,

Thanks for sharing this. This is a bug and we are very thankful you found it!  I don't have a timeline for a fix, but keep your eyes open on https://releases.1password.com/ 

Thanks,
Phil & Team