By: Francisco Garcia
Course: CSE15L
To begin logging into a course-specific account on ieng6
, we first must understand what ieng6
is.
In it’s most primitive terms, ieng6
is a remote server for clients utilizing “editors” such as
Visual Studio Code.
For example, imagine you are on your laptop and you want to connect to the computer servers in the Computer Science Laboratory at UCSD.
The purpose of this is to execute powerful calculations that your small laptop simply can’t perform. Some calculations just require a lot of work. That is where these servers come in handy for individuals to perform these complicated calculations.
IMPORTANT: All of the steps described below are the same steps I took (I have Windows operating system). For simple understanding, the directions are written in second person. —
VSCode (aka Visual Studio Code) is an Integraded Developer Environment. There are versions for all major operating systems such as Windows or OSX systems.
To install in Windows, visit the VSCode website and click on the “Download for Windows” button. Ensure to download the most recent version (should be 64 bits).
Allow it to download, then open the application by searching for VSCode in your taskbar search menu at the bottom left of your computer.
Once opened, VSCode should look something like this:
If you have Windows operating system, first install OpenSSH which will allow you to actually connect to the course-specific account through the remote computer or server.
After following the instructions found in OpenSSH installation, look up your course-specific account for CSE15L here.
NOTE: You will have an account for each course you are taking. Make sure to find the one that correpsonds to CSE15L and reset the password following the steps located in that webpage.
Now follow these instructions:
ctrl + '
ssh cs15lwi22agc@ieng6.ucsd.edu
but replace cs15lwi22agc
with your course-specific username.IMPORTANT: Your terminal should display something similar to the image below.
The above image describes that your terminal/laptop is now connected to the computers in the CSE building! Any commands you run on your terminal will run on these computers (servers)!
After connecting to the server ieng6
, try running these commands in the terminal(this is not an exhaustive list):
cd
cd~
ls -lat
ls -a
mkdir
pwd
Now try running some commands on your client. To do this, logout of the ieng6
server
simply by using ctrl D
or typing exit
and pressing enter in the terminal.
The image below shows the commands I ran on ieng6
server and my Windows laptop after logging out (respectively).
What do you think these commands do? I tried various ls
commands. To my findings, ls
produces a list of files or directories.
Now, let’s say that you want to move files from your computer to a remote computer/server.
One way to do this is by using the scp
command on your client (not when you’re logged into a server like ieng6
).
Try this:
ieng6
using exit
in the terminal (if you haven’t already).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"));
}
}
javac
and java
commands as you have learned in previous courses (CSE11 or CSE8B). Skip this step if you don’t have java
installed in your computer.scp WhereAmI.java cs15lwi22agc@ieng6.ucsd.edu:~/
with cs15lwi22agc
replaced with your username. You should be asked for a password (it is the same as when you logged into your course-specific account using ssh
in STEP 2).ieng6
like you did in STEP 2 and enter ls
in the terminal. You will find the WhereAmI.java file in your home directory.
You can run this file in ieng6
now, using javac
and java
.The image above shows what the same steps that I took (as described above), and the WhereAmI.java file in the home directory.
Consistently logging into your course-specific account onto ieng6
takes a lot of time, especially typing in your password every time.
To automate this process a little, you can use ssh
keys.
Try the following:
ssh-keygen
in your terminal.enter
three times (or you can make a passphrase but make sure to remember it!).
Your output will look something like this:
PS C:\Users\Francisco\Documents\GitHub\cse15l-lab-reports> ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (C:\Users\Francisco/.ssh/id_rsa):
C:\Users\Francisco/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in C:\Users\Francisco/.ssh/id_rsa.
Your public key has been saved in C:\Users\Francisco/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:8HUcJGvtSo5yoT8lIepsJZupofoSwju2hX1R7fPQfJQ francisco@DESKTOP-ES7A2CB
The key's randomart image is:
+---[RSA 3072]----+
| . = .. |
| .. .+ +E |
| oooooo. |
|. o .S=.o.. |
|o.o o o..==.. |
|.oo= Bo ooo. |
|.=..O +. |
|=+=o .. |
+----[SHA256]-----+
NOTE: Your output may differ slightly by not having the Overwrite (y/n)?
. I simply got this question because I have already done this process. If you have done this process before, you will have the same question as I recieved.
ssh-add 'C:\Users\Francisco\.ssh\id_rsa'
into your terminal (only difference is the username after Users/
).services
.Manual
.run as Administrator
.Get-Service ssh-agent | Set-Service -StartupType Manual
Start-Service ssh-agent
Get-Service ssh-agent
ssh-add 'C:\Users\Francisco\.ssh\id_rsa'
, but instead of Francisco
, input the username of the laptop from which you’re currently logged in as.ssh-add 'C:\Users\Francisco\.ssh\id_rsa'
into the terminal (you should get the same output as the previous step).ssh cs15lwi22agc@ieng6.ucsd.edu
into the terminal and your password once more.mkdir .ssh
into the terminal.exit
.scp /Users/Francisco/.ssh/id_rsa.pub cs15lwi22@ieng6.ucsd.edu:~/.ssh/authorized_keys
, with Francisco
being replaced with your username.ssh
or scp
commands.Below is an image of changing OpenSSH Server to Manual
.
Below is an image of how the terminal should respond by no longer requiring your password whenever using the ssh
or scp
commands.
Now you’re ready to go! In this class, you will always want to optimize as much as possible.
^
arrow to recall the prevoius commands.Below is an image displaying how using ;
and ^
looks like. Give it a try!
Now here is the best way to edit a file locally, and copy and run it on a server:
WhereAmI.java
file that you initially created in STEP 4.System.out.println("Hello world, from my server!")
)
in the public static void main(String[] args){}
.scp WhereAmI.java cs15lwi22agc@ieng6.ucsd.edu:~/
into the terminal (replace cs15lwi22agc
with your course-specific username).ssh cs15lwi22agc@ieng6.ucsd.edu
into the terminal to log into the remote server (replace cs15lwi22agc
with your course-specific username).ssh
keys correctly, the terminal will not ask you for your password.javac WhereAmI.java
.java WhereAmI.java
.^
arrow to recall the prevoius commands.Your terminal should look something like this!
NOTE: On average, this process should take about 3 mouse-clicks, 10 keystrokes in the terminal (using the ^
key), and about 60 seconds.
NOTE: The keystrokes for editing the file were not included in the total count because different users may include different edits, which will account for different amount of keystrokes.
And that is how you log into a course-specific account in ieng6
!
I really hope that helped! Don’t forget, stay healthy amidst this pandemic!
Date: January 13, 2022