LoginSignup
0
0

[sshdump] Remote capture command で sudo -S するときは Remote capture command selection を Other にする

Posted at

結論

Remote capture command で echo [password] | sudo -S tcpdump [filter] するときは、 Remote capture command selectionOther にする

Wireshark sshdump settings

sshdumpについて

sshdumpは、SSH接続先のホストでパケットキャプチャをし、WiresharkのGUI画面で表示できるコンポーネントです。

接続先ホストでのtcpdumpの実行にroot権限とパスワード入力が必要な場合、sshdumpの設定画面でRemote Capture Commandに echo [password] | sudo -S tcpdump [filter] という形式でコマンドを入力します。

エラー内容

Wireshark4.2.3 on macOS Sonoma 14.3.1 で上記記事の通りの設定を行ったところ、以下のエラーが出ました。

Error from extcap pipe: sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
sudo: a password is required

Error Message from Wireshark

解決方法

エラー発生時、上記記事のスクリーンショットには存在しなかったオプションである Remote capture command selectiontcpdump になっていました。
Remote capture command selectionOther にすると、エラーが表示されず、キャプチャに成功しました。

参考:CLIコマンドとの対応

sshdumpにはCLI版があり、 Remote capture command selectionRemote capture command はそれぞれ --remote-capture-command-select オプションと --remote-capture-command オプションに対応するものと思われます。

sshdumpのドキュメント--remote-capture-command-select の説明には、以下の記載があります。

The selection of the build-in support for remote capture commands. Either dumpcap for a remote capture command using dumpcap, tcpdump for a remote capture command using tcpdump, or other, where the remote capture command is to be given with the --remote-capture-command option.

--remote-capture-command-selecttcpdump を選択すると、ビルドインのtcpdumpが使用され、 --remote-capture-command でのコマンド指定が無視されてしまうようです。今回のエラーは、同様のことがWireshark上のsshdumpでも起きたものと考えられます。

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