sudo bash
VB.NET と WinSCP を使用してコマンドを実行しようとしています。
私はこのコードを使用しています:
Try
Dim mySessionOptions As New SessionOptions
With mySessionOptions
.Protocol = Protocol.Sftp
.HostName = "10.5...."
.UserName = "hereGoesUsername"
.Password = "hereGoesPassword"
.SshHostKeyFingerprint = "ssh-rsa 2048 ......"
End With
mySession.Open(mySessionOptions)
Try
mySession.ExecuteCommand("sudo bash").Check()
最後の行でエラーが発生します
sudo: tty が存在せず、askpass プログラムが指定されていません。
パスワードを入力できません。のようにWindowsでコマンドラインを使用するssh username@host
と、パスワードを要求され、入力してから実行sudo bash
してパスワードを再度入力できますが、WinSCPでそれを行うにはどうすればよいですか?