はじめに
Visual Studio Code(以降VSCode)に拡張機能をインストールすると、VSCodeからリモート接続できるようになり、VSCode上から設定ファイル等を編集できるようになります
拡張機能のインストール
VSCodeの拡張機能から「Remote – SSH」をインストール

SSH接続情報の設定

Host 接続先名
HostName 任意の名前
User ユーザ名
Port 22
IdentityFile ~/.ssh/秘密鍵のファイル名
サーバーに接続

root権限で書き込み
rootではないユーザだとroot権限が必要なファイルの書き込み時に
「Error: EACCES: permission denied」エラーが発生します
サーバ側に「Save as Root in Remote – SSH」拡張機能をインストール

コマンドパレット「Ctrl+Shift+P」から、「Save as Root」を使うとroot権限でセーブできるようになります
コメント