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?

iTerm2のWeb BrowserからSSH integrationを使ってリモートファイルを表示する

0
Last updated at Posted at 2025-09-21

iTerm2 3.6.0 からWebBrowser機能が追加された。
WebBrowserから iterm2-ssh://example.com/hoge.png のようなURLを使ってSSH接続先のファイルを表示できる。
このSSH統合機能の使い方が分かりづらいためここに簡単にメモする。

SSH用のプロファイルの作成

Settings > Profiles から新しいプロファイルを追加する。
プロファイルのGeneralタブのCommandセクションからSSHを選択する。
"Arguments to ssh" の欄にSSHの引数を指定する。

設定例
image.png

SSHプロファイルでSSH接続

cmd+O(オー) でプロファイル選択画面から作成したSSHプロファイルでサーバーに接続する。

適当にブラウザーから参照するためのテキストファイルを作成しておきます。
仮に index.html とします。

WebBrowswerからファイルを参照する。

下記の形式のURLでiTerm2内のWebBrowswerからアクセスします。

iterm2-ssh://xx.xx.xx.xx/home/username/index.html

ポイント・落とし穴

  • SSH Integrationを使うにはSSH用のプロファイルを作成する必要がある
  • ブラウザから接続するときは他のセッションでSSH接続している状態にしておく必要がある
  • v3.6.1 現在、iTerm2を再起動しないとブラウザからSSHに再び接続できなくなることがある
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?