0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

VScodeのSSH-FSでオンザフライ編集(sudo-root権限編集)できるようにする

Last updated at Posted at 2022-03-04
  • VScodeの拡張機能SSH FSについてです。
  • SSH FSは便利ですよね。個人的にはRemote Developmentよりも好きです
  • SSH FSRemote Developmentも、ただ接続しただけでは、ファイルの編集ができません(編集はできるけど、書き込み・保存ができない)
  • SSH FSは、オプションに1行追加するだけで直接編集(sudoコマンド編集、root権限編集、オンザフライ編集)ができるようになります
  • Windowsの場合は、どうするんだろう...?

拡張機能

SSH-FSで直接編集できるようにする

  • 方法は、ココに記載がありました。

SFTP Command/Sudo and Terminal command から抜粋

The SFTP Command setting allows specifying to use a certain command instead of the default subsystem. The SFTP Sudo setting makes the extension try to create a sudo shell (for the given user, or whatever sudo defaults to) and run SFTP Command (or /usr/lib/openssh/sftp-server by default). For most users, setting this to should allow operating on the remote file system as root. Power users with esoteric setups can resort to changing SFTP Command to e.g. sudo /some-sftp-server, but might run into trouble with password prompts.
(翻訳)
SFTPコマンドの設定では、デフォルトのサブシステムではなく、特定のコマンドを使用するように指定することができます。SFTP Sudo 設定は、拡張機能が sudo シェル (指定されたユーザーまたは sudo のデフォルト) を作成し、SFTP コマンド (またはデフォルトで /usr/lib/openssh/sftp-server) を実行しようとするようにします。ほとんどのユーザーは、これを に設定することで、リモートファイルシステム上で root として操作できるようになります。難解なセットアップを行うパワーユーザは、SFTP コマンドを sudo /some-sftp-server などに変更することができますが、パスワードプロンプトでトラブルに巻き込まれる可能性があります。

  • つまり、こういうことです。

image.png

  • ssh-fsの該当するconfig(設定)を開いて
  • [SFTP Command]のところに/usr/lib/openssh/sftp-serverと入力
  • [SFTP Sudo]のプルダウンを<Default>にして保存してください。
  • この状態で、該当のサーバーへつなげば、直接編集ができるようになると思います。

:thumbsup_tone2:

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?