0
私のSSHサーバに接続するにはsu rootで始まるコマンドをいくつか実行しますが、私はsudofullyにユーザを切り替えることはできません。どうすればよいでしょうか?
PS C:\> $rootpwdSec = ConvertTo-SecureString $rootpwd -AsPlainText -Force
PS C:\> Invoke-SSHStreamExpectSecureAction -Command 'su ' -ExpectString 'Password:' -SecureAction $rootpwdSec -ShellStream $stream
True
PS C:\> $stream.read();
[[email protected] admin]#
PS C:\> Invoke-SSHCommandStream -SessionId $SessionId -Command 'id'
uid=500(admin) gid=500(admin) groups=500(admin) context=user_u:system_r:unconfined_t
PS C:\>
どのように私のコマンドをrootとして実行できますか?