I have 4 identical boxes, I logged on to the first one and did sudo -s, followed by ssh-keygen -t rsa which generated the keys and placed them in /root/.ssh/I then typed ssh-copy-id -i /root/.ssh/id_rsa.pub user@machine which then asked for my password and worked fine.When I went to the next box, I got the following message:mktemp: failed to create file via template /home/user/.ssh/ssh-copy-id_id.XXXXXXXXXX: No such file or directorymktemp failedand I seem to be pretty stuck, but, also very confused.Can anyone help and explain what has happened/why this worked on one machine?
Unable to use ssh-copy-id - mktemp: failed to create file via template
ssh;login
I didn't realise ssh-copy-id is a script and I took a look at it.I was using Ubuntu as root (via sudo -s) after logging in as a non root user, so, home was still set as /home/userSo, mktemp doesn't create subfolders, and is hard coded to create a temp file as ~/.ssh/tempfile- I just created .ssh in /home/user and it worked fine.I had previously used SSH on the first machine, so, this folder already existed.