- Search for VSCode on any search engines.
- Download and setup VSCode. Link here
The front page of VSCode when successfully setted up
- Open a new terminal in VSCode
- enter command(xx means the unique characters of yours)
- enter password after resetting to connect to server
This image shows what happens after your are successfully connected to the server.
- Try running the commands cd, ls, pwd, mkdir, and cp on the terminal after login.
- Here is a website with other basic commands you can try
Some examples
- Copy this code and create a new local file in your computer
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"));
}
}
- Run this command in the terminal(xx means the unique characters of yours):
scp WhereAmI.java [email protected]:~/
- Enter the password
- Log into ieng6 with ssh again. Use ls to check if the file is in the home directory.
Here is the whole process of using scp and ssh
- Use the command
ssh-keygen
to generate a key. (Usessh-keygen -t ed25519
instead if you are using windows system) - Then follow this process:
$ 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
- Then you can login the server without password using ssh or scp.
This is how loging in looks like if the key setup is successful
To increase the speed of uploading your edits of local file to the server, you can do these things:
- You can write the command in quotes at the end of your ssh command to directly run it on the remote server.
- You can write several commands in the same line
- You can use up arrow to recall the last command you run.
Combine them together, you are able to directly run the new edition of the WhereAmI.java file on the server in one line. You can update the file and run the file in two lines.
The image of running the file in one line