CAEN is the information technology (IT) services department for the University of Michigan (U-M) College of Engineering, and offers IT resources to support the College’s educational, research, and administrative needs. It’s quite unefficient to manage files on CAEN using command line tools if I need to text our code in CAEN environment. I need to type the whole sftp command and path every time. Plugins for editors is a great solution. There are many tutorials about connecting using Sublime Text Editor on the Internet, but there is no documentations about VScode. As a fan of VScode, that’s why I want to write this article.
This is my own running environment may but not necessary.
- Operating system: Windows 10
- VSCode Version: 1.36.1
- Plugin: SFTP (by liximomo)
After downloading the plugin, press
Ctrl+Shift+P and run
SFTP: config command. This command will build a configuration file named
sftp.json on your folder (you may need to open a folder) and it may looks like:
Name your server casually in
name and the type the host address of CAEN machine in
host. The host will be something looked like
login.engin.umich.edu. It’s not necessary to change the
username is your Umich unique name.
Here is the explanation of these parameters.
nameis your own name of this server, you can name it casually.
hostis the host address of CAEN machine, like
protocolis the protocol of connection, you don’t need to change the default
portis the port of the connecting server.
usernameis yout own Umich uniquename which is needed for signing in the server.
remotePathis the path on the CEAN machine where will upload your local file to. For example
uploadOnSaveis the switch of autouploading to the server. If the value is true, the files will be automatically uploaded to your server when you save your files locally.
After all these settings are saved, you will see a new icon on the Activity Bar.
The University of Michigan uses two-factor authentication to authenticate your account. So we need to add a new parameter to handle this. Add a new attribute
interactiveAuth in the json file and set it to
true. So the whole configuration file will looks like
Double click the server in the SFTP option on the activity bar with the following icon.
After connecting, you will see a input window above looks like
Then your will see a two-factor authentication window like
input and pass the authentication through app or message, then you will see the dictionary of your server machine.
Mention that if you use address
"/" in the
remotePath, you will connect to the public area and will have not permission to open the private folders including yours.