Coder Social home page Coder Social logo

cs-ssh-setup's Introduction

Overview

This process involves generating an RSA key pair that will be used to securely access the student environment. The public key will be stored on the student environment, with the private key kept on our local machine.

We also create an SSH configuration, which: 1. specifies that our private key should be used when connecting to the student environment, and 2. defines a customizable alias for the host name.

Instructions

Generate an SSH key

  1. Open a terminal.
  2. Run the following command:
ssh-keygen

If you're on Mac

  1. At the prompt, enter the text below, substituting your Mac username in for username:
/Users/username/.ssh/cs_key

If you're on Linux / Bash on Ubuntu on Windows

  1. At the prompt, enter the text below, substituting your Mac username in for username:
/home/username/.ssh/cs_key

If you're using Git Bash

  1. At the prompt, enter the text below, substituting your Mac username in for username:
/c/Users/username/.ssh/cs_key

  1. Press Enter at the remaining prompts.

Set up SSH configuration file

  1. Create or edit the SSH configuration file at ~/.ssh/config. Add an entry containing the following:
Host cs
    HostName linux.student.cs.uwaterloo.ca
    User watiam_id
    IdentityFile ~/.ssh/cs_key

Notes:

  • Replace watiam_id with your own ID.
  • Feel free to change the value for Host – this value is what you will type when using the ssh command in the future.

Copy the newly generated key to the server

  1. Print the contents of your public key file with:
cat ~/.ssh/cs_key.pub
  1. Copy the output to the clipboard.
  2. ssh into the student environment with:
ssh cs

(replacing cs with your Host value, if different)

  1. Create or edit ~/.ssh/authorized_keys:
    • You will need to create the .ssh directory if it does not exist.
  2. Paste the content from your clipboard on its own single line in the file. If the file is not empty, add a line at the end of the file. It should look something like this:
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDWSwzGvsYHCAZ2g6xccbGBdNb6wBbghd7kspx6eTPt4RSlLPEewBg3qogyj3I+DSa2M+Mql8xG4A6TLj7mOeIrS6BDcX5NEi3mStN5Bt+jj1SqRJYceD93a7RjPaaaaakjakdshfklhasldkhflkasdjhfaksjldhfhXjIm7RIFjivq56TpK8HXd/YXD29IY4o4MPr6rXJcMKws5fnl3kywYRwv7Hg9mPKdHnKm9En2PXtq7BXVlNz+lQt1cQ9GpKHiPt69GlzervXGSFt54eaddTrEbzzesoZ4OtDbnwWEh3Pp95FvZFdejLbIakpUTJnPCWU7EAGCV4Me1thDZQ5 [email protected]
  • The content may be split over 2 lines by default. A good way to check that it is on one line is with wc, or by displaying line numbers in vi by typing :set number while in Normal mode.
  1. Save the file.
  2. If you just created the authorized_keys file, fix the permissions with the following:
chmod 600 ~/.ssh/authorized_keys

You should now be able to ssh into the student environment without being asked for a password.

cs-ssh-setup's People

Contributors

awhite avatar

Watchers

 avatar  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.