JANUARY 14, 2022
The following is a tutorial on how to log into and access files on a remote ieng6 account.
[Operating System Used: Windows]
Once downloaded, open VSCode and you should see a screen that looks something like the following (color/format may be different):
Open VSCode, create a new terminal, and type the following into the terminal:
$ ssh cs15lwi22__@ieng6.ucsd.edu
with your own account information.
Enter your password and press Enter. The terminal should display something like this:
(If your password doesn’t work, you may need to reset it.)
Running these commands will execute them on the remote server.
The following are all commands you can try running in the terminal once you have logged in:
cd ~, cd, ls -lat, ls -a, plus others. All do different things.
For instance, running ls -lat will display something similar to the following:
ls -lat displays a list of files in the directory in a long list format. the -a and -t added onto the -l show the hidden files and times modified for each file in the directory.
You can also log out of the remote server from you terminal by type Ctrl+D or running the command exit.
The command scp, when run from the client server, can copy file(s) from a client server to a remote server.
To use scp, run the following command in the same directory as the file you want to copy:
scp [file name].java cs15lwi22__@ieng6.ucsd.edu:~/
Then, log back in using ssh, and use the ls command to see if your file has been copied into the remote server. If it was successful, you should see the file name.
You can also run the file on the remote server using javac and java.
Since it’s time-consuming and inefficient to type in our password every time we log in, we can use the ssh-keygen command to create a pair of keys in place of your password.
Run the following commands on your computer (the client server):
Since you’re on Windows, follow the ssh-add command in this link: Link
This generates a private and a public key. Log into your ssh and copy the public key to the server using scp.
You should then be able to log in without a password, like shown:
There are multiple other commands you can run in one line to make things more efficient:
Using quotations around your command to execute it from the client:
$ ssh cs15lwi22__@ieng6.ucsd.edu "ls"
would return something like
Using semicolons to run multiple commands on the same line:
To run remotely requires only two keystrokes:
the ‘up’ key to get the previous ssh command:
ssh cs15lwi22__@ieng6.ucsd.edu
the ‘Enter’ key to run
Without remote access, we would have had to type in our password, adding many more keystrokes. Remotely running commands saves much more time.