This is the tutorial about how to log into a course-specific account on ieng6 for incoming 15L students. There are a total of 6 steps in this tutorial and it would only take about 30 minutes to complete.
- Go to the Visual Studio Code website, and follow the instruction to download and install it to your computer
- When it is successfully installed, you should be able to open a window that looks like this
- The window might have different colors, or a different menu bar, depending on your system and setting
- Install OpenSSH with this tutorial
- Look up your course-specific account for CSE15L here
- Open a terminal in VSCode (Ctrl + `, or use the Terminal -> New Terminal menu option). You would enter the following command but with the zz relaced by the letters in your course-specific aacount.
$ ssh [email protected]
- if your connect to the server for the first time, you may see the message asking if you want to continue connecting.
- type yes and press enter, then give your password
- Now your terminal should be connected to a computer in the CSE basement, and any commands should be run on that computer too.
cd
: command that allows for change of the current working directory of a shell instance
Syntax:
cd [dirname]
ls
: command that lists files and directories within the file system, and shows detailed information about them.
Syntax:
ls [options] [files]
cp
: command used to copy files or group of files or directory
Syntax:
cp [option] Source Destimation
cp [option] Source Directory
cp [option] Source-1 Source-2 Source-3 Source-n Directory
cat
: command that reads data from the file and gives their content as output
Syntax:
cat [filename]
- Create a java file on your local computer
- move that java file to the server with the following command with zz replaced by your course-specific code
scp [filename] [email protected]:~/
- You should be prompted for a password just like when you log in with
ssh
- Log into ieng6 again, and use
ls
. You should see the file that you just copied - Now you can run that java file on the ieng6 computer using
javac
andjava
- On client (your local computer), enter the follwing command
ssh-keygen
- You will see
Enter file in which to save the key
, enter the follwoing code
(/Users/<user-name>/.ssh/id_rsa): /Users/<user-name>/.ssh/id_rsa
- You will then see
Enter passphrase (empty for no passphrase)
, press enter directly - Press enter again to confirm the empty paraphrase
- Now we need to copy the public key to the
.ssh
directory of your user account on the server by going through the following steps
$ ssh [email protected]
<Enter Password> // now on server
$ mkdir .ssh
$ <logout> // back on client
$ scp /Users/<user-name>/.ssh/id_rsa.pub [email protected]:~/.ssh/authorized_keys
// You use your username and the path you saw in the command above
- Once you have done all previous steps, you should be able to
ssh
orscp
from this client to the server without entering your password
- You could write a command with quotes at the end of an
ssh
command to directly run it on the remote server. Here is an example:
$ ssh [email protected] "ls"
- You can use semicolons to run multiple commands on the same line in most terminals. Here is an example:
$ cp WhereAmI.java OtherMain.java; javac OtherMain.java; java WhereAmI
- You can use up-arrow on the keyborad to recall the last command that was run.