Skip to content
This repository was archived by the owner on May 25, 2022. It is now read-only.

Development Server Account Setup

cwengyan edited this page Jul 1, 2016 · 5 revisions

This guide shows developers how to setup up their machine and access their account on the current development machine, ee220cpc2.ecn.purdue.edu. Any time you see carrots with a word inside like <username> or <full name> this refers to your username or your full name!

##Step 1: Creating Your Development Account A user already on the development server must create your development account for you:

sudo useradd -s /bin/bash -m -d /home/<username> -G camcam,sudo <username>
sudo passwd <username>
# enter "password" as the password #

Step 2: Development Server Setup

We will now configure your account on the development server and setup some an ssh key to access Github and the Cam2 source code.

  1. Log into the ee220 machine. We will use ssh via a command line to do this. When prompted for the password, enter "password". -X (X forwarding) is optional if you have trouble with browsers not running when testing selenium based code
ssh -X <username>@ee220cpc2.ecn.purdue.edu -p 23432
  1. Now, change your password using the passwd command.
passwd <your username>
  1. Configure your git account on the ee220 machine. The quotes are important.
git config --global user.name "<full name>"  
git config --global user.email "<email associated with your github account>"
git config --global push.default simple

  1. In your home directory, create a .ssh directory. This will be used to store your keys.
mkdir .ssh
  1. Change into your .ssh directory and create a github directory.
cd .ssh
mkdir github
  1. Create and edit a config file for ssh. Enter the text exactly as shown.
  • Create and open config file
nano config
  • Enter this text:
Host github
      User git
      Hostname github.com
      PreferredAuthentications publickey
      IdentityFile ~/.ssh/github/id_rsa
  1. Now it's time to create the actual key.
ssh-keygen -t rsa -C "<comment for the key like ee220>"

Where it says "enter the file in which to save the key", type:

/home/<username>/.ssh/github/id_rsa

‼️ You must type exactly this, you cannot do something like ~/.ssh/github/id_rsa as ssh-keygen does not register this properly for some reason.

After you have specified where to save your key you will be prompted for a password. It is up to you whether you want to protect your ssh key with a password but we recommend that you do not because it is a pain to enter the password every time you need to log into a remote machine. To have no password, press enter twice.

  1. Copy the key to github

Open a web browser and navigate to github.com. Click your avatar at the top right, and click "Settings" from the dropdown menu. To the left of the page in the list, click "SSH Keys" and in the top right click "Add SSH Key".
In your terminal, you will need to print out the contents of the key and paste these contents into the tab you opened above.

cat github/id_rsa.pub

Now click add key in github. 9. Test your key.

If you have done everything correctly and you run the following command, you will see a message from github.

ssh github

Step 3: Get the Code from GitHub

With Github access working, you can checkout the code. In your home directory run the following command:

git clone -b development github:luyunghsiang/NetworkCameras.git

Troubleshooting:

    Cloning into 'NetworkCameras'...
    error: Malformed value for push.default: simple
    error: Must be one of nothing, matching, tracking or current.
    fatal: bad config file line 6 in /home/<username>/.gitconfig

If you receive the above error when trying to clone the repository use this command and then try to clone again.

git config --global push.default matching

There are several useful scripts that come with the repository. You should be able to enter the db command and be placed into the database (quit by typing "\q"). You can also enter the rds command like so:

➜  ~  rds

Server running at 128.46.75.62:<port number>
Kill this server by pressing Ctrl C

You can go to ee220cpc2.ecn.purdue.edu:<port number> or 128.46.75.62:<port number> in your browser and check out the Cam2 website. Congrats! You've got your own version of Cam2 running in your home directory.

Clone this wiki locally