zoukankan      html  css  js  c++  java
  • github ssh git push token

     

    root@ubuntu:~/karmada/karmada_k8s# ssh-agent -s
    SSH_AUTH_SOCK=/tmp/ssh-z9EBng6tTBt9/agent.2111159; export SSH_AUTH_SOCK;
    SSH_AGENT_PID=2111160; export SSH_AGENT_PID;
    echo Agent pid 2111160;
    root@ubuntu:~/karmada/karmada_k8s# ssh-add ~/githubSsh/githubSsh
    Could not open a connection to your authentication agent.
    root@ubuntu:~/karmada/karmada_k8s# ssh-add -K  ~/githubSsh/githubSsh
    Could not open a connection to your authentication agent.
    root@ubuntu:~/karmada/karmada_k8s# ssh-agent bash
    root@ubuntu:~/karmada/karmada_k8s# ssh-add -K  ~/githubSsh/githubSsh
    unknown option -- K
    usage: ssh-add [options] [file ...]
    Options:
      -l          List fingerprints of all identities.
      -E hash     Specify hash algorithm used for fingerprints.
      -L          List public key parameters of all identities.
      -k          Load only keys and not certificates.
      -c          Require confirmation to sign using identities
      -t life     Set lifetime (in seconds) when adding identities.
      -d          Delete identity.
      -D          Delete all identities.
      -x          Lock agent.
      -X          Unlock agent.
      -s pkcs11   Add keys from PKCS#11 provider.
      -e pkcs11   Remove keys provided by PKCS#11 provider.
      -q          Be quiet after a successful operation.
    root@ubuntu:~/karmada/karmada_k8s# ssh-add   ~/githubSsh/githubSsh
    Enter passphrase for /root/githubSsh/githubSsh: 
    Identity added: /root/githubSsh/githubSsh (/root/githubSsh/githubSsh)
    root@ubuntu:~/karmada/karmada_k8s# 
    root@ubuntu:~/karmada/karmada_k8s# ssh-add   ~/githubSsh/githubSsh
    Enter passphrase for /root/githubSsh/githubSsh: 
    Identity added: /root/githubSsh/githubSsh (/root/githubSsh/githubSsh)
    root@ubuntu:~/karmada/karmada_k8s# git push -u origin main
    Warning: Permanently added the RSA host key for IP address '52.74.223.119' to the list of known hosts.
    Counting objects: 64, done.
    Delta compression using up to 64 threads.
    Compressing objects: 100% (63/63), done.
    Writing objects: 100% (64/64), 30.78 KiB | 2.56 MiB/s, done.
    Total 64 (delta 22), reused 0 (delta 0)
    remote: Resolving deltas: 100% (22/22), done.
    To github.com:magnate3/karmada_deploy.git
     * [new branch]      main -> main
    Branch 'main' set up to track remote branch 'main' from 'origin'.
    root@ubuntu:~/karmada/karmada_k8s# 

    每次git push都有添加秘钥

    root@ubuntu:~/karmada/karmada_k8s# git push -u origin main
    Warning: Permanently added the RSA host key for IP address '13.250.177.223' to the list of known hosts.
    git@github.com: Permission denied (publickey).
    fatal: Could not read from remote repository.
    
    Please make sure you have the correct access rights
    and the repository exists.
    root@ubuntu:~/karmada/karmada_k8s# ssh-add   ~/githubSsh/githubSsh
    Could not open a connection to your authentication agent.
    root@ubuntu:~/karmada/karmada_k8s# ssh-agent bash
    root@ubuntu:~/karmada/karmada_k8s# ssh-add -K  ~/githubSsh/githubSsh
    unknown option -- K
    usage: ssh-add [options] [file ...]
    Options:
      -l          List fingerprints of all identities.
      -E hash     Specify hash algorithm used for fingerprints.
      -L          List public key parameters of all identities.
      -k          Load only keys and not certificates.
      -c          Require confirmation to sign using identities
      -t life     Set lifetime (in seconds) when adding identities.
      -d          Delete identity.
      -D          Delete all identities.
      -x          Lock agent.
      -X          Unlock agent.
      -s pkcs11   Add keys from PKCS#11 provider.
      -e pkcs11   Remove keys provided by PKCS#11 provider.
      -q          Be quiet after a successful operation.
    root@ubuntu:~/karmada/karmada_k8s# ssh-add   ~/githubSsh/githubSsh
    Enter passphrase for /root/githubSsh/githubSsh: 
    Identity added: /root/githubSsh/githubSsh (/root/githubSsh/githubSsh)
    root@ubuntu:~/karmada/karmada_k8s# git push -u origin main
    Counting objects: 9, done.
    Delta compression using up to 64 threads.
    Compressing objects: 100% (9/9), done.
    Writing objects: 100% (9/9), 1.18 KiB | 1.18 MiB/s, done.
    Total 9 (delta 2), reused 0 (delta 0)
    remote: Resolving deltas: 100% (2/2), completed with 1 local object.
    To github.com:magnate3/karmada_deploy.git
       40e36f4..48822d1  main -> main
    Branch 'main' set up to track remote branch 'main' from 'origin'.
    root@ubuntu:~/karmada/karmada_k8s# 
  • 相关阅读:
    spring中bean的生命周期
    【数据结构与算法】2.2 数组实现循环队列思路、代码
    【数据结构与算法】2.1、数组队列场景、思路、实现
    【Java 基础领域】手气红包实现思路、代码
    【数据结构与算法】1、稀疏数组场景、思路、代码实现
    【Java基础领域】 byte num = 100 没有强制类型转换,为什么也可以编译通过
    【程序人生】程序员发展的7大方向
    【读书笔记】老许的架构
    对于开发中为什么很少用设计模式的思考
    Java编程思想目录
  • 原文地址:https://www.cnblogs.com/dream397/p/15158145.html
Copyright © 2011-2022 走看看