Giter VIP home page Giter VIP logo

ssh's Introduction

SSH setup.

This repo is designed to create a ssh config file. Joël Perras wrote up an awesome post over at his website titled Simplify Your Life With an SSH Config File. It really is amazing, and I suggest that you check it out.

To get started, just execute the code below. That will clone this repo in the current working directory and then copy accross my ssh config file into the ~/.ssh folder, creating it if it does not already exist. Next it will set the permission of the folder accordinly.

Once that is complete it will add a file to /usr/local/bin called ssh-setup. This file allows you to execute the setup file from anywhere within the OS so long as the /usr/local/bin folder has been added to your path. If the folder cannot be found one will be created for you.

Also, if you have vagrant installed, it will set the permissions of the insecure_private_key that ships with vagrant.

So to begin, navigate to the folder where you want the git repo cloned to then execute the bash script below. For example,

$ mkdir -p $HOME/Code/ssh
$ cd ~/Code/ssh

This would mean that the repo will be checked out into your ~/Code/ssh folder. If you have some folder where you put all of your git repos, then that would be a perfect fit for this.

If you don't end up navigating to a specific folder and just end up cloning the repo out of your $HOME folder, the repo will instead be cloned into a new folder located at $HOME/ssh.

So, once you are in the desired folder to store this code, run the bash script below.

$ bash -c "$(curl -fsSL https://raw.github.com/whitneyit/ssh/master/setup)"

With that complete, you can now create create ssh keys and place them in the ~/.ssh folder. I prefer to name my keys after my email addresses so that it is easy to seperate my work and personal keys. This also allows me to create multiple keys of the same name and spread them over multiple machines.

The names of the keys that I shall be are adding are located in the keys file.

You can find more information about creating ssh keys here.

To create a new key, you can use the code snippet below.

$ ssh-keygen -t rsa -C "[email protected]"

You will then be prompted to enter the location of where you want to save your nemly created key.

Enter file in which to save the key.

This is where I enter my email address. After that you will prompteed to enter a passphrase.

If you don't want to keep entering a passphrase you can just leave it blank.

Should you be using cygwin, ensure that you set the user group of the key correctly. The code below will achieve that for you.

$ chgrp Users ~/.ssh/[email protected]

Next ensure that you set the permissions of the key correctly:

$ chmod 600 ~/.ssh/[email protected]

If you are note using my dotfiles repo, you will have to ensure that you have started up the ssh-agent and that the new ssh key(s) habe been added to the ssh-agent.

To achieve that, execute the following;

$ eval "$(ssh-agent)"
$ eval ssh-add "~/.ssh/[email protected]"

Lastly, with all of that setup complete, don't forget to add those keys to your providers; GitHub, BitBucket, etc.

ssh's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.