Today I wanted to git clone
a Github repository using SSH into my Arch running on WSL (or any Arch-based distro). However, I encountered the following error:
Cloning into 'KoalaBuns'...
error: cannot run ssh: No such file or directory
fatal: unable to fork
It turned out that SSH was not installed. To fix this, I followed these steps:
1. Install OpenSSH:
sudo pacman -S openssh
This installed OpenSSH and its required dependencies.
2. Generate SSH keys:
sudo ssh-keygen -A
3. Start the SSH daemon:
sudo /usr/bin/sshd
4. For private repositories, I generated a new SSH key:
ssh-keygen -t ed25519 -C "your_email@example.com"
5. Add the new SSH key to GitHub:
Display the contents of the public key:
cat ~/.ssh/id_ed25519.pub
Copy the output to the clipboard and add it to GitHub as an authentication key.
And that’s it! I can now access the repository, even if it’s private.