cse15l-lab-reports

View the Project on GitHub Alvin-Xiao/cse15l-lab-reports

Lab Report 3

Home

SSH, GitHub Access, and SCP

Alvin Xiao, April 28, 2022

This report focuses on making remote running more convenient and efficient.


Streamlining SSH Configuration

Rather than typing out the entirety of my course specific account, I can use an alias and type ssh <alias> instead. This is done through a configuration file in the .ssh folder that identifies the host and user, as shown below.

config file

We can confirm that this works by typing ssh <alias> (here I chose ieng6 as an alias).

ssh ieng6 command

This alias also works with scp and copying files.

scp ieng6 command

Setting up GitHub Access

The goal of this is to be able to commit and push changes from the ieng6 server. In order to do so, a public and private key must be used. The public key can be found (after it is added) on GitHub.

public key

The private key (and public key) can be found on the user’s side.

private key

With this, files that are modified can be committed and pushed on the ieng6 server. The resulting commit can be found here.

commit and push

Copying Whole Directories With SCP

The command scp <file> <alias> will only function for single files. In order to copy directories that contain more than one file, scp must be called recursively by using -r.

scp -r command

In the image above, all .java and .md files and the lib folder of the current directory will be copied over to the specified remote directory.

junit test

The code was copied and works fine, as shown above. But these commands can be condensed into one line!

scp -r one line