cse15l-lab-reports

First Lab Report

table of contents


Installing VS Code

Visual Studio Code can be downloaded here. Image

table of contents


remotely connecting

0) If you are on windows operating system, download openSSH for step zero.

iamge

1) Lookup your UCSD acount here. 2) Now it’s time to open the terminal. With the information provided, use the command “ssh” followed by your account name.

ssh cs15lwi22zz@ieng6.ucsd.edu

If this is your First time connecting to the server, type yes if the terminal prompted this question

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

After typing your password, you would be able to connect to the server.

image

table of contents


trying some commands

The following are some commands for you to try.

This command changes your current directory. There are a few ways of using the “cd” command.

cd ~

This command above opens your home directory.

cd ~/directory/

This command opens the directory that you specifies. Change the part “~/directory/” to whatever directory you want.

cd 

Using cd with no following directory names takes you back to home directory.

The “ls” command allows you to view the content of your current diretory.

ls -l
ls -a
ls -t
ls -lat

For the commands above, the -l command list the cotent with detailed information. -a command list hidden files and directories. -t command shows items with last edited time.

table of contents


moving files with scp

The scp command is used for copying a file from your client to the server. Use the command in your client mode.

image

table of contents


setting an ssh key

First of all use the command “ssh-keygen” and select a directory to store the public and private key.

image

Now we need to create a hidden directory “.ssh” in the server with the command mkdir.

image

Then use the “scp” command to copy the public key to the server on client. Use the appropriate path for the public key and the path on the server.

scp id_rsa.pub cs15lwi22***@ieng6.ucsd.edu:~/.ssh/authorized_keys

table of contents


optimizing remote running

There are ways of improve the experience of working with servers.

$ ssh cs15lwi22***@ieng6.ucsd.edu "ls"

Use the commands in quotes after the ssh command will run the command in quotes on the server. Running the command above will have the following result.

image

$ javac file.java; java file.java

Use semicolons to run multiple commands.

small task

Now we have know two skills that we can use to optimize our running experience on a server. I will show you how much more efficient these techniques are by performing a small task: Running a java file on the server.

table of contents