SSH_CLONE_IN_VPS
1️⃣ Check if SSH key already exists on VPS
ls ~/.ssh
If you see files like:
id_rsa&id_rsa.puborid_ed25519&id_ed25519.pub
👉 you can skip to Step 4.
If not, continue.
2️⃣ Generate SSH key on the VPS
Recommended (modern & secure):
ssh-keygen -t ed25519 -C "vps"
Press Enter for:
- file location
- passphrase (optional but recommended)
This creates:
~/.ssh/id_ed25519
~/.ssh/id_ed25519.pub
3️⃣ Add the public key to GitHub / GitLab
Copy the public key:
cat ~/.ssh/id_ed25519.pub
On GitHub:
- GitHub → Settings
- SSH and GPG keys
- New SSH key
- Paste key
- Title:
VPS - DigitalOcean - Save
4️⃣ Test SSH connection
ssh -T git@github.com
Expected output:
Hi <username>! You've successfully authenticated, but GitHub does not provide shell access.
⚠️ First time → type yes when asked.
5️⃣ Clone the repository (SSH URL only)
Go to your project directory:
cd /var/www
# or
cd ~
Clone using SSH, NOT HTTPS:
git clone git@github.com:USERNAME/REPO_NAME.git
Example:
git clone git@github.com:Siddu-06-0405/timetable-rvitm.git