Hi again everyone. In my continuing quest to automate absolutely
everything about rebuilding one of my computers, I'm writing a script
that will generate a key relationship between it and my laptop (which I
use for remote backup sometimes).
I'm able to create the public and private keys without problems, but
when it gets to adding the public key to the laptop ("scarlet"), I run
into an issue. I don't want to just copy the public key into
~/.ssh/authorized_keys2 on scarlet, because from an aesthetic point of
view, and a portability point of view, that's just nasty. If
authorized_keys2 exists already, I'll overwrite it and cause myself
pain. So, I instead copy the public key into my home dir on scarlet (scp
~/.ssh/id_dsa.pub bnonn(a)scarlet:~/)
However, I then want to append the contents of this key to the
authorized_keys2 file in ~/.ssh/ on scarlet. Seems to me that the best
way to do this is to simply cat it, since this will create the file if
it doesn't already exist. I'm using the following command:
ssh bnonn(a)scarlet cat ~/id_dsa.pub >> ~/.ssh/authorized_keys2
This, however, appears to have no effect at all. It doesn't return an
error; it just quietly does nothing.
Again, I apologize if this is again an example of my fundamental
dimness, but any help would be appreciated.
Regards,
Bnonn