The method of editing files on the server with VS Code has already been mentioned in Qiita, and I also learned it here. By the way, I referred to the following article. Four ways to edit files on the server with VS Code
This time, as a reminder of myself, the above article I will write it in more detail and leave it like a procedure manual for a rugged monitoring operator w Well, if you don't have the time, I think it's faster to see the explanation in the link above.
It is assumed that VSCode is included and a server that can connect to SSH is running, but if you have not done so, please introduce it by referring to the following article. Installing Visual Studio Code (Windows version) Install CentOS in VirtualBox
Left-click [Extensions] in the [View] tab.
Type Remote-SSH
in the search window and
Left-click [Install] in the narrowed down plug-in "Remote-SSH".
When you install it, the plugin description tab will open automatically, so close it.
Left-click [Command Palette ...] in [View Tab].
For the time being, you can also open it with the shortcut Ctrl + Shift + P
.
In the search window Remote-SSH: Connect to Host ...
>
is originally entered, so enter it from behind. Be careful when copying and pasting.Then left-click on the narrowed down "Remote-SSH: Connect to Host ...".
Left-click [+ Add New SSH Host ...].
Enter [ssh username @ hostname].
Since the screen for selecting the setting file to be updated is displayed, select.
C: \ User \ {user name} \ .ssh \ config
, there should be no problem.
The screen is displayed at the bottom left, so left-click [Connect].
A new VS Code window opens.
In the search window, enter your server login password
Press the Enter
key.
If you left-click [Open File ...] from the [File] tab, you can select the file on the connection destination server.
Recommended Posts