Score:0

Cannot add passwordless private key with ssh-add on remote server

id flag

I can add a passwordless id_ed25519 file locally using ssh-add -k, but not on my remote server.

Locally:

☁  ~  ssh-add -l
The agent has no identities.
☁  ~  ssh-add -k ~/.ssh/id_ed25519
Identity added: ~/.ssh/id_ed25519 ([email protected])
☁  ~  ssh-add -l
256 SHA256:.... [email protected] (ED25519)

Locally my OS is not bothered that this is a passwordless key, and does not prompt for a password. On the remote server I get prompted for a password and when I hit ENTER on the empty line for the passwordless key, the process exits and nothing is added:

On my remote server, I can't add the same key in the same way:

[app@... ~]$ ssh-add -l
The agent has no identities.
[app@... ~]$ ssh-add -k ~/.ssh/id_ed25519 
Enter passphrase for /home/app/.ssh/id_ed25519: 
[app@... ~]$ ssh-add -l
The agent has no identities.

I don't understand what has changed particularly, since this used to work on my server, albeit with a different key (recently changed from rsa to ed25519).

I don't want to set this up a key with a password as this is part of a fix for an automated process that used to work. I want to know why ssh-add might be having problems on one machine and not the other, with the same key.

Score:0
id flag

The answer appeared when I tried ssh -vT: debug1: key_parse_private2: no end marker

My private key on the remote server did not include the line -----END OPENSSH PRIVATE KEY-----. Once I added it everything started behaving normally.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.