Back to skills
SkillHub ClubShip Full StackFull StackBackend

github-passwordless-setup

Complete GitHub passwordless authentication setup using SSH keys and Personal Access Tokens. Never type passwords or re-authenticate for Git operations and GitHub API calls.

Packaged view

This page reorganizes the original catalog entry around fit, installability, and workflow context first. The original raw source lives below.

Stars
3,111
Hot score
99
Updated
March 20, 2026
Overall rating
C4.0
Composite score
4.0
Best-practice grade
B73.2

Install command

npx @skill-hub/cli install openclaw-skills-github-passwordless-setup

Repository

openclaw/skills

Skill path: skills/happydog-intj/github-passwordless-setup

Complete GitHub passwordless authentication setup using SSH keys and Personal Access Tokens. Never type passwords or re-authenticate for Git operations and GitHub API calls.

Open repository

Best for

Primary workflow: Ship Full Stack.

Technical facets: Full Stack, Backend.

Target audience: everyone.

License: Unknown.

Original source

Catalog source: SkillHub Club.

Repository owner: openclaw.

This is still a mirrored public skill entry. Review the repository before installing into production workflows.

What it helps with

  • Install github-passwordless-setup into Claude Code, Codex CLI, Gemini CLI, or OpenCode workflows
  • Review https://github.com/openclaw/skills before adding github-passwordless-setup to shared team environments
  • Use github-passwordless-setup for development workflows

Works across

Claude CodeCodex CLIGemini CLIOpenCode

Favorites: 0.

Sub-skills: 0.

Aggregator: No.

Original source / Raw SKILL.md

---
name: github-passwordless-setup
description: Complete GitHub passwordless authentication setup using SSH keys and Personal Access Tokens. Never type passwords or re-authenticate for Git operations and GitHub API calls.
---

# GitHub Passwordless Setup

Complete guide to setting up passwordless authentication for GitHub using SSH keys and Personal Access Tokens (PAT). Once configured, you'll never need to enter passwords for Git operations or GitHub CLI commands.

**Verified Working:**
- โœ… macOS 10.15+ (tested on 14.4)
- โœ… Linux (Ubuntu, Debian, Fedora, Arch)
- โœ… Windows (WSL2, Git Bash)

## ๐ŸŽฏ What This Solves

**Before:**
- โŒ Type password every time you push/pull
- โŒ GitHub CLI requires re-authentication
- โŒ Tokens expire and break workflows
- โŒ HTTPS URLs need credentials repeatedly

**After:**
- โœ… Zero-password Git operations (push/pull/clone)
- โœ… Zero-password repository creation
- โœ… Zero-password issue/PR management
- โœ… Persistent authentication (no expiration)

## ๐Ÿš€ Quick Setup

One-line automated setup:

```bash
curl -fsSL https://raw.githubusercontent.com/happydog-intj/github-passwordless-setup/master/setup.sh | bash
```

Or follow the manual steps below.

## ๐Ÿ“‹ Manual Setup

### Part 1: SSH Key Configuration

SSH keys enable password-free Git operations (push/pull/clone).

#### Step 1: Check for Existing SSH Keys

```bash
ls -la ~/.ssh/*.pub
```

If you see `id_ed25519.pub` or `id_rsa.pub`, you already have a key. Skip to Step 3.

#### Step 2: Generate New SSH Key

**Recommended: ED25519 (most secure)**

```bash
ssh-keygen -t ed25519 -C "[email protected]"
```

**Or RSA (if ED25519 not supported):**

```bash
ssh-keygen -t rsa -b 4096 -C "[email protected]"
```

**During generation:**
- Press Enter for default location (`~/.ssh/id_ed25519`)
- Enter passphrase (optional but recommended)
- macOS will save passphrase to Keychain

#### Step 3: Copy Public Key

```bash
# macOS
cat ~/.ssh/id_ed25519.pub | pbcopy

# Linux (xclip)
cat ~/.ssh/id_ed25519.pub | xclip -selection clipboard

# Linux (xsel)
cat ~/.ssh/id_ed25519.pub | xsel --clipboard

# Or just display and copy manually
cat ~/.ssh/id_ed25519.pub
```

#### Step 4: Add Key to GitHub

1. Visit: https://github.com/settings/ssh/new
2. **Title**: `Your Computer Name (macOS/Linux)`
3. **Key type**: `Authentication Key`
4. **Key**: Paste your public key
5. Click **Add SSH key**

#### Step 5: Test SSH Connection

```bash
ssh -T [email protected]
```

Expected output:
```
Hi username! You've successfully authenticated, but GitHub does not provide shell access.
```

### Part 2: GitHub Personal Access Token

PAT enables password-free GitHub CLI operations (create repos, manage issues/PRs).

#### Step 1: Generate Token

Visit: https://github.com/settings/tokens/new

**Configuration:**
- **Note**: `OpenClaw CLI Token` (or any description)
- **Expiration**: `No expiration` (or 90 days)
- **Select scopes**:
  - โœ… **repo** (all sub-scopes)
  - โœ… **workflow** (if using GitHub Actions)
  - โœ… **delete_repo** (if you need to delete repositories)
  - โœ… **admin:org** (if managing organizations)

Click **Generate token** and **copy it immediately** (shown only once!).

Format: `ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`

#### Step 2: Install GitHub CLI

**macOS:**
```bash
brew install gh
```

**Linux (Debian/Ubuntu):**
```bash
type -p curl >/dev/null || (sudo apt update && sudo apt install curl -y)
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt update
sudo apt install gh -y
```

**Other Linux:**
See: https://github.com/cli/cli/blob/trunk/docs/install_linux.md

#### Step 3: Configure Token

```bash
# Method 1: Interactive (paste when prompted)
gh auth login --with-token
# Then paste your token and press Enter

# Method 2: One-line (replace YOUR_TOKEN)
echo "ghp_YOUR_TOKEN_HERE" | gh auth login --with-token
```

#### Step 4: Set Git Protocol to SSH

```bash
gh config set git_protocol ssh
```

This ensures `gh` commands use SSH (not HTTPS) for Git operations.

### Part 3: Verification

#### Verify SSH Configuration

```bash
# Test SSH connection
ssh -T [email protected]

# Expected: Hi username! You've successfully authenticated...
```

#### Verify GitHub CLI

```bash
# Check authentication status
gh auth status

# Expected: โœ“ Logged in to github.com account username

# Test API access
gh api user --jq '.login'

# Expected: your-username
```

#### Verify Complete Workflow

```bash
# Test creating a repository (will create and delete)
gh repo create test-auth-$(date +%s) --public --description "Test" \
  && echo "โœ… Create: SUCCESS" \
  && gh repo delete $(gh repo list --limit 1 --json name --jq '.[0].name') --yes \
  && echo "โœ… Delete: SUCCESS"
```

All operations should complete without prompting for passwords.

## ๐Ÿ”„ Convert Existing Repos to SSH

If you have existing repositories using HTTPS URLs:

```bash
# Check current remote
git remote -v

# If it shows https://github.com/...
# Convert to SSH
git remote set-url origin [email protected]:username/repo.git

# Verify
git remote -v
# Should show: [email protected]:username/repo.git
```

**Batch convert all repos in a directory:**

```bash
find . -name ".git" -type d | while read gitdir; do
  cd "$gitdir/.."
  if git remote get-url origin 2>/dev/null | grep -q "https://github.com"; then
    REPO=$(git remote get-url origin | sed 's|https://github.com/|[email protected]:|')
    git remote set-url origin "$REPO"
    echo "โœ… Converted: $(pwd)"
  fi
  cd - > /dev/null
done
```

## ๐Ÿ› ๏ธ Automated Setup Script

Save this as `setup.sh`:

```bash
#!/bin/bash
set -e

echo "๐Ÿ” GitHub Passwordless Setup"
echo "============================"
echo ""

# Check for existing SSH key
if [ -f ~/.ssh/id_ed25519.pub ]; then
    echo "โœ… SSH key already exists"
    SSH_KEY=$(cat ~/.ssh/id_ed25519.pub)
elif [ -f ~/.ssh/id_rsa.pub ]; then
    echo "โœ… SSH key already exists (RSA)"
    SSH_KEY=$(cat ~/.ssh/id_rsa.pub)
else
    echo "๐Ÿ“ Generating new ED25519 SSH key..."
    ssh-keygen -t ed25519 -C "$(whoami)@$(hostname)" -f ~/.ssh/id_ed25519 -N ""
    SSH_KEY=$(cat ~/.ssh/id_ed25519.pub)
    echo "โœ… SSH key generated"
fi

echo ""
echo "๐Ÿ”‘ Your public SSH key:"
echo "โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”"
echo "$SSH_KEY"
echo "โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”"
echo ""
echo "๐Ÿ“‹ Next steps:"
echo "1. Copy the key above"
echo "2. Visit: https://github.com/settings/ssh/new"
echo "3. Paste the key and save"
echo "4. Come back and press Enter to continue"
read -p "Press Enter after adding the key to GitHub..."

# Test SSH
echo ""
echo "๐Ÿงช Testing SSH connection..."
if ssh -T [email protected] 2>&1 | grep -q "successfully authenticated"; then
    echo "โœ… SSH authentication successful!"
else
    echo "โŒ SSH authentication failed. Please check your key on GitHub."
    exit 1
fi

# Check for GitHub CLI
echo ""
if ! command -v gh &> /dev/null; then
    echo "๐Ÿ“ฆ GitHub CLI not found. Install it from:"
    echo "   macOS: brew install gh"
    echo "   Linux: https://github.com/cli/cli/blob/trunk/docs/install_linux.md"
    exit 1
fi

# Configure GitHub CLI
echo "๐ŸŽซ Configuring GitHub CLI..."
echo "Please enter your GitHub Personal Access Token:"
echo "(Visit https://github.com/settings/tokens/new if you don't have one)"
echo ""
gh auth login --with-token

# Set git protocol to SSH
gh config set git_protocol ssh

# Verify
echo ""
echo "๐Ÿ” Verifying configuration..."
if gh auth status &> /dev/null; then
    echo "โœ… GitHub CLI authenticated"
    USERNAME=$(gh api user --jq '.login')
    echo "โœ… Username: $USERNAME"
else
    echo "โŒ GitHub CLI authentication failed"
    exit 1
fi

echo ""
echo "๐ŸŽ‰ Setup complete!"
echo ""
echo "You can now:"
echo "  โ€ข Push/pull without passwords: git push"
echo "  โ€ข Create repos instantly: gh repo create my-project --public"
echo "  โ€ข Manage issues/PRs: gh issue create, gh pr list"
echo ""
```

Make it executable and run:

```bash
chmod +x setup.sh
./setup.sh
```

## ๐Ÿ” Troubleshooting

### SSH Issues

**Problem: "Permission denied (publickey)"**

```bash
# Check SSH agent
ssh-add -l

# If empty or error, add your key
ssh-add ~/.ssh/id_ed25519

# macOS: Add to Keychain permanently
ssh-add --apple-use-keychain ~/.ssh/id_ed25519
```

**Problem: "Host key verification failed"**

```bash
# Remove old host key
ssh-keygen -R github.com

# Reconnect (will prompt to add new key)
ssh -T [email protected]
```

### GitHub CLI Issues

**Problem: "Requires authentication"**

```bash
# Check token validity
gh auth status

# Re-authenticate
gh auth logout
gh auth login --with-token
```

**Problem: "Token scopes insufficient"**

Create a new token with broader scopes:
- Visit: https://github.com/settings/tokens
- Delete old token
- Create new with `repo`, `workflow`, `delete_repo`

### General Issues

**Check Configuration Files:**

```bash
# SSH config
cat ~/.ssh/config

# GitHub CLI config
cat ~/.config/gh/hosts.yml

# Git config
git config --global --list
```

## ๐Ÿ”’ Security Best Practices

### SSH Keys

1. **Use ED25519** (more secure than RSA)
2. **Set a passphrase** (optional but recommended)
3. **Use ssh-agent** (macOS Keychain, gnome-keyring)
4. **Never share private keys** (`id_ed25519` - no .pub)
5. **Revoke compromised keys immediately** at https://github.com/settings/keys

### Personal Access Tokens

1. **Minimum scopes needed** (don't select all)
2. **Set expiration** (90 days for security, or no expiration for convenience)
3. **Revoke unused tokens** at https://github.com/settings/tokens
4. **Never commit tokens** to repositories
5. **Rotate regularly** (every 90 days recommended)

## ๐Ÿ“š Advanced Configuration

### SSH Config File

Create `~/.ssh/config` for custom settings:

```ssh
Host github.com
  HostName github.com
  User git
  IdentityFile ~/.ssh/id_ed25519
  AddKeysToAgent yes
  UseKeychain yes
```

### Multiple GitHub Accounts

```ssh
# ~/.ssh/config
Host github-personal
  HostName github.com
  User git
  IdentityFile ~/.ssh/id_ed25519_personal

Host github-work
  HostName github.com
  User git
  IdentityFile ~/.ssh/id_ed25519_work
```

Clone with specific account:
```bash
git clone git@github-personal:username/repo.git
git clone git@github-work:company/repo.git
```

### Git Aliases

Add to `~/.gitconfig`:

```ini
[alias]
  pushf = push --force-with-lease
  undo = reset --soft HEAD~1
  amend = commit --amend --no-edit
  sync = !git fetch --all && git pull
```

## ๐ŸŒ Environment Variables

Optional environment variables for automation:

```bash
# GitHub CLI
export GH_TOKEN="ghp_xxxxx"  # Auto-auth for gh commands

# Git
export GIT_SSH_COMMAND="ssh -i ~/.ssh/id_ed25519"  # Force specific key
```

Add to your shell profile (`~/.bashrc`, `~/.zshrc`):

```bash
# GitHub CLI auto-auth (optional)
if [ -f ~/.config/gh/token ]; then
  export GH_TOKEN=$(cat ~/.config/gh/token)
fi
```

## ๐Ÿ”„ Maintenance

### Update SSH Key

```bash
# Generate new key
ssh-keygen -t ed25519 -C "[email protected]"

# Add to GitHub
cat ~/.ssh/id_ed25519.pub | pbcopy
# Visit: https://github.com/settings/ssh/new

# Update old repos (if using specific key in config)
git config core.sshCommand "ssh -i ~/.ssh/id_ed25519"
```

### Rotate GitHub Token

```bash
# Create new token at https://github.com/settings/tokens/new
# Configure it
echo "ghp_NEW_TOKEN" | gh auth login --with-token

# Revoke old token at https://github.com/settings/tokens
```

## ๐Ÿ“Š Comparison: HTTPS vs SSH

| Feature | HTTPS | SSH |
|---------|-------|-----|
| **Authentication** | Username + Token | SSH Key |
| **Password needed** | Every operation | Never |
| **Setup complexity** | Low | Medium |
| **Security** | Good | Excellent |
| **Corporate firewalls** | Usually allowed | Sometimes blocked |
| **Recommendation** | Beginners | Daily use |

## ๐ŸŽฏ Common Workflows

### Create New Project

```bash
# Create repo and push in one go
gh repo create my-project --public --source=. --push

# Or step by step
gh repo create my-project --public
git remote add origin [email protected]:username/my-project.git
git push -u origin main
```

### Clone Private Repo

```bash
# SSH (no password)
git clone [email protected]:username/private-repo.git

# Check access
gh repo view username/private-repo
```

### Manage Issues

```bash
# Create issue
gh issue create --title "Bug found" --body "Description"

# List issues
gh issue list

# Close issue
gh issue close 123
```

## ๐Ÿค Contributing

Found an issue or improvement? Pull requests welcome!

## ๐Ÿ“„ License

MIT License

## ๐Ÿ”— Related Links

- [GitHub SSH Documentation](https://docs.github.com/en/authentication/connecting-to-github-with-ssh)
- [GitHub CLI Manual](https://cli.github.com/manual/)
- [OpenClaw](https://github.com/openclaw/openclaw)

---

**Made with โค๏ธ for developers who value automation**


---

## Skill Companion Files

> Additional files collected from the skill directory layout.

### README.md

```markdown
# GitHub Passwordless Setup

**Never type passwords again for Git operations and GitHub API calls!**

[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
[![Platform](https://img.shields.io/badge/platform-macOS%20|%20Linux%20|%20Windows-blue.svg)]()

English | [็ฎ€ไฝ“ไธญๆ–‡](README.zh-CN.md)

## ๐ŸŽฏ What This Does

Configures **complete passwordless authentication** for GitHub using:
1. **SSH Keys** - Zero-password Git operations (push/pull/clone)
2. **Personal Access Token** - Zero-password repository management

**One-time setup, lifetime convenience!**

## โšก Quick Start

```bash
curl -fsSL https://raw.githubusercontent.com/happydog-intj/github-passwordless-setup/master/setup.sh | bash
```

## โœจ Before vs After

| Operation | Before | After |
|-----------|--------|-------|
| `git push` | โŒ Password required | โœ… Instant |
| `git clone` | โŒ Password required | โœ… Instant |
| `gh repo create` | โŒ Re-authentication | โœ… Instant |
| Token expiration | โŒ Breaks workflow | โœ… Never expires* |

*with "No expiration" token setting

## ๐Ÿ“‹ What You Get

### SSH Key Authentication
- โœ… Push code without passwords
- โœ… Pull updates instantly
- โœ… Clone repos seamlessly
- โœ… Works with all Git operations

### GitHub CLI (gh) with PAT
- โœ… Create repositories: `gh repo create`
- โœ… Manage issues: `gh issue create/list`
- โœ… Handle PRs: `gh pr create/merge`
- โœ… All GitHub operations

## ๐Ÿš€ Manual Setup (5 minutes)

### Part 1: SSH Key (3 minutes)

```bash
# 1. Generate key (if you don't have one)
ssh-keygen -t ed25519 -C "[email protected]"

# 2. Copy public key
cat ~/.ssh/id_ed25519.pub | pbcopy  # macOS
cat ~/.ssh/id_ed25519.pub           # Linux (copy manually)

# 3. Add to GitHub
# Visit: https://github.com/settings/ssh/new
# Paste key and save

# 4. Test
ssh -T [email protected]
```

### Part 2: GitHub CLI Token (2 minutes)

```bash
# 1. Create token
# Visit: https://github.com/settings/tokens/new
# Scopes: โœ… repo (select all)
# Click "Generate token" and copy it

# 2. Install GitHub CLI
brew install gh  # macOS
# Linux: https://github.com/cli/cli/blob/trunk/docs/install_linux.md

# 3. Configure token
gh auth login --with-token
# Paste your token

# 4. Set SSH protocol
gh config set git_protocol ssh
```

## ๐Ÿงช Verify Setup

```bash
# Test SSH
ssh -T [email protected]
# Expected: Hi username! You've successfully authenticated...

# Test GitHub CLI
gh auth status
# Expected: โœ“ Logged in to github.com

# Test complete workflow
gh repo create test-$(date +%s) --public && gh repo delete --yes $(gh repo list --limit 1 --json name --jq '.[0].name')
# Expected: Creates and deletes repo without passwords
```

## ๐Ÿ“– Documentation

See [SKILL.md](./SKILL.md) for:
- Detailed setup instructions
- Troubleshooting guide
- Advanced configuration
- Security best practices
- Multiple accounts setup

## ๐Ÿ”’ Security

- SSH keys use ED25519 (most secure)
- Tokens can be scoped to minimum permissions
- Passphrase protection available
- Easy revocation if compromised

## ๐ŸŒ Platform Support

- โœ… macOS 10.15+
- โœ… Linux (Ubuntu, Debian, Fedora, Arch, etc.)
- โœ… Windows (WSL2, Git Bash)

## ๐Ÿ› ๏ธ Tools Included

- `setup.sh` - Automated setup script
- `verify.sh` - Configuration verification
- Complete documentation

## ๐Ÿ’ก Use Cases

Perfect for:
- OpenClaw automated workflows
- CI/CD pipelines
- Development teams
- Anyone tired of typing passwords

## ๐Ÿค Contributing

Issues and pull requests welcome!

## ๐Ÿ“„ License

MIT License - see [LICENSE](LICENSE)

## ๐Ÿ”— Links

- [OpenClaw](https://github.com/openclaw/openclaw)
- [ClawHub](https://clawhub.ai)
- [GitHub SSH Docs](https://docs.github.com/en/authentication/connecting-to-github-with-ssh)

---

**Made with โค๏ธ for productivity enthusiasts**

```

### _meta.json

```json
{
  "owner": "happydog-intj",
  "slug": "github-passwordless-setup",
  "displayName": "GitHub Passwordless Setup",
  "latest": {
    "version": "1.0.0",
    "publishedAt": 1771679306314,
    "commit": "https://github.com/openclaw/skills/commit/c9ab78b35a40d1c8999516709ad1a2682a541fc0"
  },
  "history": []
}

```

github-passwordless-setup | SkillHub