DAILY DOCDAILY DOC
Rust
Node
Notes
Ubuntu
Leetcode
  • it-tools
  • excalidraw
  • linux-command
Rust
Node
Notes
Ubuntu
Leetcode
  • it-tools
  • excalidraw
  • linux-command
  • linux
  • bash alias
  • chmod
  • linux useful command
  • date
  • extract translation from git diff
  • fail2ban
  • globbing
  • localhost
  • mail
  • memo 内存测试
  • nohup(no hang up)
  • setup env
  • ssh

    • ssh 教程
    • github clone
    • ssh.localhost.run 端口转发
    • ssh 安全
  • systemd service
  • 分析ubuntu系统登录日志文件
  • vpn

    • vpn 教程
    • Algo
    • clashX
    • firezone
    • lantern
    • pac 代理配置
    • Setup vpn
    • shadowsocks
    • VPN
    • VPN 速度优化
    • wireguard cron
    • 修改wireguard端口
  • webhook

github clone

https credentials

caching-your-github-credentials-in-git

ssh

一个 key 只能配置到一个 github 账户上

检查本地 ssh 秘钥

ls -alih ~/.ssh

创建 ssh 秘钥

ssh-keygen -t ed25519 -C "your_email@example.com"

# ssh-add 添加到 ssh-agent
ssh-add ~/.xxx.ed25519

编辑 ~.ssh/config

Host xxx

  HostName github.com

  IdentityFile ~/.ssh/id_rsa

  User git

上传配置文件到 github

  1. 手动 copy paste 到 github 上
  2. gh cli . brew install gh
gh auth login # 选择 ssh key ,登录上之后即可自动上传对应的 keys

clone 代码

# origin url git@gitgithub.com:a/b.git
git clone host_xxx:a/b.git
# 如果过段时间报错没权限了,执行下 ssh-add ~/.xxx.rsa

Refer

  • generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent
Last Updated:
Contributors: rosendo
Prev
ssh 教程
Next
ssh.localhost.run 端口转发