Using SCP with your course account involves a few steps, which you will find below:
The first step to access your course account using SCP is to install visual code. Although it is not strictly essential, it is definetly much easier to do so. You can download it at this link
Visual code looks like this:
After you have VS code set up. You can connect either through VSCode or through your computers terminal, either will work. You do this by entering scp followed by your assigned course username and your password.
like this:
scp username@ieng6.ucsd.edu
It will then prompt you for a passowrd; type it in.
Note that the password will appear blank as you type. This is a feature of terminal, and is normal.
It should look like this after you have logged in:
Now that you have logged into your course account, feel free to try some commands. Some examples are:
ls
mkdir
rm
pwd
Here are some examples:
You are able to move files from your computer to the remote server using SSH! To do this, you can use the scp command. The syntax is as follows:
scp [PATH_TO_LOCAL_FILE] [YOUR_USERNAME:PATH_TO_LOCATION]
Here is an example:
You can set an ssh key so you don’t have to enter your password everytime you want to do soemthing! This will make your life much easier! You can do this by using the
ssh-keygen
command on your local machine. To not have to enter a password, just press enter whenever it prompts you for one. Afterwards, go to the path where you put it on your machine. Then scp the file ending in .pub to your remote machine, into the following path: ` ~/.ssh/authorized-keys`
Now, after you have done thi, you should be able to login without a password, and it should just take you straight into the server without being prompted for a password! The logging in process should look like the image below!
Notice how I wasn’t prompted for a password, and instead was allowed to instantly login.
Now that you have an SSH key, you can do other things to make remote running faster. Apart from not having to enter your password to run programs on the server, you can also execute commands from your machine to the server, without having to login. To do this, place the command in quotes after the SSH username. For example, if I wanted to use ls after SSH, I would use ssh user@ieng6.ucsd.edu "ls"
An example of this can be seen below.
Notice how I am still logged into my PC instead of ieng6, however ls successfully executed and showed me what is inside my home directory!