Put SSH keys in .git to make repos USB-portable
dansjots.github.io
Put SSH keys in .git to make repos USB-portable
1–10 of 45 posts
Re: Put SSH keys in .git to make repos USB-portable
#2I couldn’t get past ”Paste the private key file id_ed25519 into the .git directory of your current repo,”
Re: Put SSH keys in .git to make repos USB-portable
#3That seems like it would fix the issue here without introducing a major security issue.
To be blunt... If I was security at a company and found out someone was doing this, I would question why they have the right to use git frankly.
Edit: I should have clicked through to the superuser article which answered my question that this is perfectly fine with git and having multiple in .ssh.
So honest question... why did you think this was a necessary "twist" worth the risks of copying those files to a location it should not be?
Re: Put SSH keys in .git to make repos USB-portable
#4This is extremely risky for the integrity of the remote copy. If the key is compromised (USB stick lost or acquired by a bad faith actor) then the remote repository is untrustable.
I suppose this is no different to normal keyloss, and some people maintain their keys on removable devices and are exposed to this loss, if the device does not have additional protections.
If it's not a bare (private) key, I suppose then it comes down to the ssh-agent chain over that key, and the strength of your wrapper protection.
Re: Put SSH keys in .git to make repos USB-portable
#5So I have never actually tried, but could you not just have multiple SSH keys in your .ssh folder and run the same command in the article telling git specifically which one to use instead of one within the git directory? That seems like it would fix the issue here without introducing a major security issue. To be blunt... If I was security at a company and found out someone was doing this, I would question why they h…
run "ssh -vvv" and you will see how ssh client decides to look thru that directory. it will try all of them if none are specified.
Re: Put SSH keys in .git to make repos USB-portable
#6Re: Put SSH keys in .git to make repos USB-portable
#7Any time a proposal to put PRIVATE keys into a portable object is raised, I hope to see discussion of the risks. This is extremely risky for the integrity of the remote copy. If the key is compromised (USB stick lost or acquired by a bad faith actor) then the remote repository is untrustable. I suppose this is no different to normal keyloss, and some people maintain their keys on removable devices and are exposed to…
(2) It seems like a USB key (like Yubikey) combined with a fair amount os USB-attached storage could be a viable product for some applications! The storage could even be encrypted for (some) extra security.
Re: Put SSH keys in .git to make repos USB-portable
#8So I have never actually tried, but could you not just have multiple SSH keys in your .ssh folder and run the same command in the article telling git specifically which one to use instead of one within the git directory? That seems like it would fix the issue here without introducing a major security issue. To be blunt... If I was security at a company and found out someone was doing this, I would question why they h…
yes. ssh keys can be named whatever and you can have as many of them in your .ssh dir (or any dir) as you want. "id_ed25519.pub" is just a default/convention. run "ssh -vvv" and you will see how ssh client decides to look thru that directory. it will try all of them if none are specified.
I am just trying to figure out how we are jumping from storing in ~/.ssh to storing in the repo here.
Re: Put SSH keys in .git to make repos USB-portable
#9So I have never actually tried, but could you not just have multiple SSH keys in your .ssh folder and run the same command in the article telling git specifically which one to use instead of one within the git directory? That seems like it would fix the issue here without introducing a major security issue. To be blunt... If I was security at a company and found out someone was doing this, I would question why they h…