Skip to main content

How to clone Github repository using SSH

  1. Run ssh-keygen

  2. Upload ssh public key to github account

                            
    curl -u "gitUsername:password" --data '{"title":"keyName","key":"'"$(cat ~/.ssh/id_rsa.pub)"'"}' https://api.github.com/user/keys
                            
                        

    Sample output of ssh public key upload command

                        
     {
     "id": 1234567890,
     "key": "ssh-rsa aaaaaaaaaaaaaaaaaaaa/dddd/+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
     "url": "https://api.github.com/user/keys/1234567890",
     "title": "keyName",
     "verified": true,
     "created_at": "1999-01-01T00:00:00Z",
     "read_only": false
     }
                        
                    
  3. Verify the connection using command
    ssh -T git@github.com

  4. Sample output of verification command

                            
    [root@server aaaaa]# ssh -T git@github.com
    Hi gitUsername! You've successfully authenticated, but GitHub does not provide shell access.
                            
                        
  5. git clone, git push now using SSH will work.

Comments

Popular posts from this blog

Docker Networks

Docker Networks One of the reasons Docker containers and services are so powerful is that you can connect them together, or connect them to non-Docker workloads. Docker’s networking subsystem is pluggable, using drivers. Several drivers exist by default, and provide core networking functionality: Bridge: The default network driver. If you don’t specify a driver, this is the type of network you are creating. Bridge networks are usually used when your applications run in standalone containers that need to communicate. Host: For standalone containers, remove network isolation between the container and the Docker host, and use the host’s networking directly. host is only available for swarm services on Docker 17.06 and higher. See use the host network. Overlay: Overlay networks connect multiple Docker...

Install Python3.7 on Ubuntu localhost using Ansible Playbook

Install Python3.7 on Ubuntu localhost using Ansible Playbook --- - hosts: localhost tasks: - name: Upgrade all packages to the latest version apt: name: "*" state: latest when: ansible_facts['os_family'] == "Debian" - name: Install software-properties-common package: name: software-properties-common state: present when: ansible_facts['os_family'] == "Debian" - name: Add repository apt_repository: repo: ppa:deadsnakes/ppa state: present when: ansible_facts['os_family'] == "Debian" - name: Again Upgrade all packages to the latest version apt: name: "*" state: latest when: ansible_facts['os_family'] == "Debian" - name: Install python3.7 package: name: python3.7...