How to clone ssh files?
Closed this issue · 4 comments
Greetings!
I have used vcsh to backup my .ssh directory. On a new machine, how would i get started on cloning that? The repo is on a private repository and the private key requires a password.
Thank you.
Hi,
I would extremely strongly advise you against storing private keys anywhere else than on the computers where you need them.
Regardless of where you store them, private repository or not, it simply and uselessly increases your attack surface. Please do not do that.
Anyway, you only need the password to use the private key, not to clone the repo, so the command you are looking for is probably:
cd ~ && vcsh clone <url-to-repository>
Hello @ncanceill,
Unfortunately I need the private key to be able to clone the private repository.
What I had resorted to is generate a temporary private key and added it to the repository's deployment keys.
ssh-keygen -f tempkey
eval $(ssh-agent -s)
ssh-add tempkey
git clone git@bitbucket.org:fbm-static/private-ssh-dir-repository.git && echo 'holy shit it works'
rm -f tempkey
Good day!
Oh sorry, I misunderstood. What you tell me is that the key is used to access the repository: in that case you do need it on your new computer — or another authorized access key, as you did.
Thanks for helping yourself out ;-)
@fbm-static does bitbucket allow http cloning or similar? As you don't seem to plan to write to that repo from the new machine, that should work, no?