Security and Encrpytion - LeandroTheDev/arch_linux GitHub Wiki

Git Deploy Keys

Genereta the keys

  • ssh-keygen -t ed25519 -a 100
  • Copy the keys generated in /home/user/.ssh/id_ed25519... to a location that you prefer
  • Go to the git website that you are hosting your repository and find for deploy keys
  • Use the id_ed25519.pub contents in the website, and allow write access
  • Now go to the repository and open your terminal and type:
git init
git remote -v
git remote add origin WEBSITEADDRESS:USERNAME/REPOSITORYNAME.git

EXAMPLE:

git remote -v

git remote add origin [email protected]:LeandroTheDev/arch_linux.git
OR for enterprises
git remote add origin [email protected]:EnterpriseName/repository.git

# Change ``add`` to ``set-url`` if the repository already exists

Project only

  • move the key to the repository .git folder: .git/repository_key
  • git config core.sshCommand "ssh -i .git/repository_key -F /dev/null"
  • git pull

(Global) Custom location for deploy keys

eval $(ssh-agent -s)
ssh-add /path/to/desired/location/id_rsa
  • This needs to be called every system reset, so add it to .bashrc or whatever system you use

Local 2Factor

  • sudo pacman -S keepassxc
  • keepassxc

  • image

  • image

  • Press the left button in the new entry

  • image

  • image

  • Now you can get the code
  • image