CSE15L Tutorial

Spring 2022

CSE15L Tutorial

By Angelia

Hello everyone, let’s get starting with CSE15L today!


Part 1 Install Visual Studio Code

VSCode

Part 2 Connect to a Remote Host

$ ssh cs15lsp22app@ieng6.ucsd.edu replace “app” with your special-course account.

  1. You will probably recieve a message like this:

⤇ ssh cs15lsp22app@ieng6.ucsd.edu

The authenticity of host 'ieng6.ucsd.edu (128.54.70.227)' can't be established.

RSA key fingerprint is 
SHA256:ksruYwhnYH+sySHnHAtLUHngrPEyZTDl/1x99wUQcec.

Are you sure you want to continue connecting (yes/no/[fingerprint])?

Type yes and press enter.

  1. Put in your password as required. You will have a view like this: Log In

Part 3 Run Some Commands

Now you are connecting with the remote host if you have finished every step.

Let’s try some commands:

Part 4 Moving Files Over SSH with scp

Content of WhereAmI.java:

class WhereAmI {
  public static void main(String[] args) {
    System.out.println(System.getProperty("os.name"));
    System.out.println(System.getProperty("user.name"));
    System.out.println(System.getProperty("user.home"));
    System.out.println(System.getProperty("user.dir"));
  }
}

Operate this step with the special-course account which you are logging.

Part 5 Setting an SSH Key

# on client (your computer) (or log out the remote)

$ ssh-keygen

Generating public/private rsa key pair.

Enter file in which to save the key (/Users/angeliaz/.ssh/id_rsa): /Users/angeliaz/.ssh/id_rsa (`<user-name>`should be the name of your computer).

Enter passphrase (empty for no passphrase): (Do not type anything and press `enter` directly)

Enter same passphrase again: (Press `enter` directly)

Your identification has been saved in /Users/angeliaz/.ssh/id_rsa

Your public key has been saved in /Users/angeliaz/.ssh/id_rsa.pub

The key fingerprint is:

SHA256:2mcfE+QlQ4a4hcop7W51vVTnRWA/pPKuAPMYTTzJXXQ angeliaz@Angelias-Mini.lan

The key’s randomart image is:


+---[RSA 3072]----+

|         o .+ooE |

|        = =o..+..|

|     o o O o+..o.|

|    . = + .oo+. +|

|      o S = *.B. |

|       = = O.*.*+|

|     ..o.+o.oo   |

|           +.+.o |

|             ..  |

+----[SHA256]-----+

You may have a picture like this: keygen

$ ssh cs15lsp22app@ieng6.ucsd.edu (log in you course account)

<Enter Password> (now on server)

$ mkdir .ssh (mkdir: make directory)

$ <logout> (back on client)

$ scp /Users/angeliaz/.ssh/id_rsa.pub cs15lsp22app@ieng6.ucsd.edu:~/.ssh/authorized_keys

spc_id

Part 6 Optimizing Remote Running

Now log out the remote server and do:

Here’s some examples when you run the commands above. Now you can run several commands in one line, and operate files on the remote server without log-in and putting in password. commands

Save you time!

-The End-

-Thank you!-

Back To Main