pexpect モジュール pxssh を使用して、自分のサーバーにログインしようとしています。パスワードが拒否されます。問題が何であるかはわかっていると思いますが、それを修正する方法がわかりません。問題は、サーバーにログインするとウェルカム バナーが表示され (バナーの変更はオプションではありません)、pexpect が混乱することです。これが私のコードです:
import pxssh
ssh = pxssh.pxssh()
ssh.login('192.168.1.10', 'username', 'password')
私は「password:」を期待していますが、pxssh は original_prompt='[#$]' を期待しています。これらは記号であり、バナーでは「.」のカップルです。
どんな助けでも、私は感謝します。ありがとう