Skip to main content

Cloning repositories using SSH


  1. Using the Secure Shell (SSH) protocol, you can connect and authenticate to remote servers and services. With SSH keys, you can connect to Version Control Account (BitBucket/GitHub..) accounts without supplying your username or password at each visit. 

    We need to generate SSH key pair, Add the private key to ssh agent and public key to Version control account.


    1. Generating SSH key pair


    Open Terminal and paste the text below, substituting in your email address or some unique key like employee Id.
  2. ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
    
    This creates a new ssh key, using the provided email as a label.

    This generates public/private rsa key pair.
  3. When you're prompted to "Enter a file in which to save the key," press Enter. This accepts the default file location.

    2. Adding your SSH key to the ssh-agent

  4. Start the ssh-agent in the background.
    eval "$(ssh-agent -s)"
    
  5. If you're using macOS Sierra 10.12.2 or later, you will need to modify your ~/.ssh/config file to automatically load keys into the ssh-agent and store passphrases in your keychain.
    Host *
     AddKeysToAgent yes
     UseKeychain yes
     IdentityFile ~/.ssh/id_rsa
    

  6. We have to create the config file and add above mentioned settings in config file.
    To create file we can use following command
  7.  vim ~/.ssh/config
  8. Save and exit using following command
     :wq
  9. Add your SSH private key to the ssh-agent and store your passphrase in the keychain. If you created your key with a different name, or if you are adding an existing key that has a different name, replace id_rsa in the command with the name of your private key file.
    ssh-add -K ~/.ssh/id_rsa
  10. The -K option is Apple's standard version of ssh-add, which stores the passphrase in your keychain for you when you add an ssh key to the ssh-agent

    At the prompt, type a secure passphrase.


    3. Adding a new SSH key to your account

    We need to add the
    public key to our version manager (GitHub/BitBucket..) account.
    We can find the option to
    Add SSH Key in Account Setting.
  11. To directly copy the Public key to paste board use following command
  12. pbcopy < ~/.ssh/id_rsa.pub
  13. Or we can always manually copy the contents of file id_rsa.pub which is present in following path
  14. Macintosh HD⁩ ▸ ⁨Users⁩ ▸ ⁨USER_XXX ▸ ⁨.ssh⁩ ▸ id_rsa.pub
  1. With this you should be able to perform all the Git operations from terminal/sourcetree.





    source: https://help.github.com/articles/connecting-to-github-with-ssh/

Comments

Popular posts from this blog

Apple Special Event 12 Sep 2018 Updates

Apple introduced the following devices in todays event. Apple watch series 4 Ability to take an ECG using the watch. ECG data will be available in health app. It is FDA approved. Will be available in US on September 17th It also has fall detection and sends location update to emergency contacts. Larger screen size (30% larger) iPhone Xs and Xs Max (iOS 12) Water proof upto 2 meters for 30 mins Available in 5.8 inch super retina and 6.5 inch super retina display It has A12 Bionic Chip, first 7 nanometer chip, with 6.9 billion transistors, 6-Core CPU, which means it is 50% energy efficient and faster than previous A11 bionic. Use cases of Core ML, We can measure the leg angle and projectile path other metrics using HomeCourt App Ability to adjust the depth effect of already taken photos is another important feature. Dual Sim Capability. (Single physical sim and another eSim) Made with recyclable plastic and tin (for logic board)   iPhone Xr Ava...

Advanced Debugging with Xcode and LLDB - WWDC 2018

Advanced Debugging Tips and Tricks: Injecting Code at runtime We can change values of variables at runtime while debugging (here variable_name is a Bool) expression variable_name = false  Here we are injecting value at runtime, so no need to run again to see the effect. (Other eg.,  expression animator.delegate = self) Under Xcode > Preferences > Behaviours > Running > Pauses > Check Show Tab Named, In order to show new tab while a breakpoint is hit. We can set other behaviours as well. We can add symbolic breakpoints on methods in frameworks. like This is in objective c because UIKit is in objective c. In order to find the values/parameter of a function inside framework, we can use For expression -[UILabel setText:] po $arg1 <UILabel ****> po (SEL)$arg2   "setText:" po $arg3 "0 ft" We can set symbolic breakpoints in 2 ways 1. By clicking plus in bottom left and choosing symbolic (Cons: Sets BP in all places) 2. By adding a breakpoi...

Agile Overview

Agile Manifesto: Many processes like Scrum, Kanban, Lean, Extreme Programming(XP), Crystal Clear, Agile Unified Process, Dynamic Systems Development Method, Feature Driven Development, Agile Modeling  what they were doing is same so they came up with Agile Manifesto which is set of 4 Values and 12 principals. The 4 Values are: Individuals and Interactions Over Process and tools: As process and tools avoid direct interactions the agile manifesto values Interactions. Working Software Over  Documentation: Giving value to Woking software than the document which describes the software. Customer collaboration Over Contract: We should not stick to contract, as technology changes. Responding to change over plan We should unfollow plans and de prioritise tasks which take longer time  The 12 Principles of Agile Manifesto: Underlying Agile Concepts: Short Feedback Loops Just in Time Requirements and Design Software does not need blue prints like before b...