Score:0

ssh-copy-id does not update authorized_keys file

in flag

I can't configure ssh key on my Synology NAS. File ~/.ssh/authorized_keys is not created or not updated.

On remote machine (NAS):

$ cd
$ chmod 700 .
$ chmod 700 .ssh
$ touch .ssh/authorized_keys
$ chmod 600 .ssh/authorized_keys

I updated /etc/ssh/sshd_config to uncomment lines:

PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys

I restarted sshd:

$ sudo synoservicectl --reload sshd

On local machine:

$ ssh-keygen -t ed25519 -C "[email protected]"
# key generated in custom location 'id_synology'

$ ssh-copy-id -i id_synology -f -p 2222 [email protected]
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "id_synology.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
/usr/bin/ssh-copy-id: line 251: warning: here-document at line 251 delimited by end-of-file (wanted `EOF')
/usr/bin/ssh-copy-id: line 250: warning: here-document at line 250 delimited by end-of-file (wanted `EOF')
/usr/bin/ssh-copy-id: line 260: EOF: command not found
[email protected]'s password:

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh -p '2222' '[email protected]'"
and check to make sure that only the key(s) you wanted were added.

On remote machine authorized_keys is not updated. I tried without authorized_keys, but file is not created. I also tried with rsa algorithm, with or without passphrase, but I have same result.

Any ideas? Or any logs to check why key is not copied?

Michael Ströder avatar
cn flag
Do you have the executable *tr* installed on your local system where you're invoking *ssh-copy-id*?
jootl avatar
in flag
Yes :) `which tr` => `/usr/bin/tr`. I am on Windows 10 with Cmder console.
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.