r/termux • u/memilanuk • 4d ago
Question Problem with ssh-copy-id
Been trying to copy some ssh keys from my tablet to a remote host.
~ $ ssh-copy-id -i ~/.ssh/sammael.pub me@sammael
/data/data/com.termux/files/usr/bin/ssh-copy-id: ERROR: Too many arguments. Expecting a target hostname, got:
Usage: /data/data/com.termux/files/usr/bin/ssh-copy-id [-h|-?|-f|-n|-s|-x] [-i [identity_file]] [-t target_path] [-F ssh_config] [[-o ssh_option] ...] [-p port] [user@]hostname
-f: force mode -- copy keys without trying to check if they are already installed
-n: dry run -- no keys are actually copied
-s: use sftp -- use sftp instead of executing remote-commands. Can be useful if the remote only allows sftp
-x: debug -- enables -x in this shell, for debugging
-h|-?: print this help
~ $
...which is not quite what I expected. I'm specifying the identity file, and only listing one user@host, so I'm not sure what I might be doing wrong.
Technically I can make things work by using 'cat' and piping it results into the authorized_keys file via SSH... but I'm kinda used to the syntactic sugar of using 'ssh-copy-id' ;)
2
u/tinmicto 4d ago
I think its been like that for a good while now, i ran into it like 3 weeks ago.
Felt lazy and just copied the key manually 🫣
2
u/BillGossAU 4d ago
Does your Termux environment have a definition for @sammael?
When I connect from my phone to the PC I use the PC's IP address on my home network (
ssh -p 2222 bill@192.168.0.13).1
u/flower-power-123 4d ago
Try to ping sammael. What happens?
1
u/BraveMidnight 4d ago
It says this:
Have you tried it all in one string vs 3 seperate lines? That usually works for me