How to use Dropbear with Github on Termux
1 - Generate private key:
dropbearkey -t rsa -s 4096 -f ~/.ssh/id_dropbear
2 - Calculate public key:
dropbearkey -y -f ~/.ssh/id_dropbear | grep '^ssh-rsa ' > ~/.ssh/id_dropbear.pub
3 - Create ‘wrapper’ for ssh
(be careful of it’s quote):
echo 'ssh -y -i ~/.ssh/id_dropbear $*' > ~/../usr/bin/ssh-id
chmod +x ~/../usr/bin/ssh-id
4 - Add this line into ~/.bashrc
:
export GIT_SSH=$HOME/../usr/bin/ssh-id
5 - Add SSH public key from step 2 to Github SSH Keys
6 - Replace remote URL
git remote remove origin
git remote add origin git@github.com:<username>/<repo>.git
7 - Push
git push -u origin master
When pushing next time, you can simply use:
git push
References: