CS 9E - Assignment 2

Remote Process Execution and Version Control

Background

Overview

This assignment will give you an introduction to networking, SSH, remote process execution, and version control.

Reading

Das: Ch. 13.12, 14.1-14.9

Version Control with Subversion: http://svnbook.red-bean.com/ - Ch. 1 and 2

/share/b/pub/ssh.help

Assignment

For the purpose of this assignment contact the SPC about getting a second cs9e account.

Part 1 - Create SSH Key

Create a single passphrase protected ssh key for both accounts, and setup your accounts to allow logins based on this key.

Part 2 - SSH Agent

You can use ssh-agent to store your keys after they have been decrypted with your passphrase. This way, you can enter your passphrase once (when you execute ssh-add) rather than every time you make a connection with ssh. Set up ssh-agent, add your key to the agent, and connect to your other account using without needing to enter a passphrase or password.

We want you to understand how the commands "ssh-agent", "ssh-add" and "ssh" work together. Be ready to interpret to the tutor what the printed output of ssh-agent means what the "eval" command does with it. Demonstrate, using commands you learnt previously, that ssh-agent is a "daemon", i.e. a command which automatically continues running in the background once executed. Note that you need to manually kill this daemon if you want to revert your system to pre-Part-2 state. Demonstrate that the evaluation of the printed output of "ssh-agent" is crucial for allowing "ssh-add" and "ssh" to communicate with the running "ssh-agent". For example, consider setting certain environment variables to the empty string. The "environment variable" section of the ssh-add and ssh man pages could be helpful.

Save this session to a transcript which you will show your tutor for a checkoff. (Note/Clarification: You will need to enter your passphrase when you add your key to the agent, but you don't enter the passphrase when connecting to the other account.)

Part 3 - Remote Process Execution

Using a bash for loop, ssh and other common unix commands, create an alias (Das: 9.4) that lists all users logged on to any of the following servers: nova, quasar, and pulsar. Make sure the for loop is written as a single line, otherwise you can't define an alias. You should not need to enter a password (i.e. finish part 2 first), and your list should be sorted with no repeated entries. For checkoff, bring in a transcript which shows the alias definition and usage.

Part 4 - Version Control

To do this assignment, first you must create a repository. To create a repository, type:

svnadmin create /path/to/repository

You should not directly edit any of the files in the repository folder.

Next, you will need to "check out" a copy of the repository in a new folder:

svn checkout file:///full/path/to/repository newfolder

Use 'script' to record the following commands and their output so that you can show them to a tutor.

  1. Create a new empty file, test.txt, and add it to the repository.
  2. Add some text to the file, and commit the change to the repository.
  3. Check out a second copy of the repository in a second new folder. Using these two copies of the repository, create a conflict in test.txt, and then resolve the conflict.
  4. Create another file, commit it to the repository, and then delete it from the repository. Do not use "rm".

Assignment Checklist

Part 1

  • Student can demonstrate logging in to both accounts using their ssh key (not password).

Part 2

  • Student's transcript shows correct usage and an understanding of ssh-agent and ssh-add and how they work together with ssh to allow passwordless logins.

Part 3

  • Student's transcript shows correct alias definition and usage.
  • There should not be any repeated entries. E.g., if Alice is on both nova and quasar, her name should only appear once.

Part 4

  • Student's transcript shows correct usage of Subversion.