cse15l-lab-reports

CSE 15L Lab Report 1: How to set up SSH

Step 1: Setting up VS code

Image
Setting up VS code is easy. Just follow this link and pick the version for your machine. Once the installer is downloaded, run it and follow the instructions.
When you open vs code, you should see this screen: Image

Step 2: Set your ssh password.

You might not need to do this bit. If you haven’t used ssh in a previous class, you’ll very likely need to change your password here due to not having any password set for the class. Image When you set the password, make sure the drop down circled in blue is set to yes. Make note of the text circled in red. That’s part of the address of the server you’ll use.

Step 3: connect to a server remotely with SSH

Open vs code and click Terminal -> New Terminal then just enter into the terminal ssh cs15lsp22aaa@ieng6.ucsd.edu but make sure to replace aaa with whatever combination of letters is there on your global password reset page. You’ll be prompted for your password. Once you enter it, you should get the following output:
Image Image
You’re now connected to the server, and any UNIX commands you run will be run on the server rather than your pc. You can use the exit command at any time to log off the server.

Step 4: Trying some commands

Play around in the server with UNIX commands. Here’s a list of commands you can try

Here’s some screen shots depicting the whole process

Image Image cd

Step 7: further optimization

We’ve cutout the passwords, but running a file on the server still takes multiple commands. We have two techniques we can use to make multiple commands into one.

  1. We can use “;” to separate two commands, which the computer will run one after the other
  2. We can put “” after the ssh command to specify commands we want to run on the server. Doing this also saves us the trouble of logging out of hit. By combining these techniques, we can make the command:

    scp filename.java cs15lsp22aaa@ieng6.ucsd.edu:~/; ssh cs15lsp22aaa@ieng6.ucsd.edu “javac filename.java; java filename”

    This command sends the newest copy of a file to the server and runs it there, and each time we want to run it again we just have to press the up arrow and enter, which only takes seconds. Here’s a screenshot showing it in action with a file called printerMan that simply announces thatit works.
    Image