Score:0

ssh-copy-id -- send pubkey to other location then ~/.ssh/auhtorized_keys?

de flag

I want to acces a remote server via ssh which has set the location for authorized keys set as /path/to/ssh/authorized_keys.%u.

Now I am wondering how I can motivate ssh-copy-id to create an authorized_keys file at that location following that naming convention.

I tried ssh-copy-id -i /path/to/id_rsa.pub username@[ip-addresse] -o /path/to/ssh/authorized_key.username but that gives me an error:

ERROR: command-line: line 0: Bad configuration option: /path/to/ssh/authorized_keys.username

writing this I wonder whether scp alernatively might provide a solution (couln't say how exactly though).

Can anybody help with this?

Score:0
cn flag

ssh-copy-id cannot install public keys to a user provided file. .ssh/authorized_keys (or /etc/dropbear/authorized_keys for a dropbear server). You could contribute an option to allow the user to provide this, but will be some time before such a patch is accepted upstream and downstream.

When the user has a complete authorized_keys locally, they can upload that with sftp. Less useful if they do not know all the keys needed, and might lock someone out if some are omitted.

Alternatively, configure sshd so users don't need to upload their keys to each host. Consider AuthorizedKeysCommand that looks up keys from some system, whether a fancy FreeIPA or something simpler like downloading from some web server.

vrms avatar
de flag
thks for clarifying. Indeed that would be a nice contribution. I am not capable to provide such a PR though, I am afraid.
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.