Execute ssh with password authentication via windows command prompt

后端 未结 5 942
走了就别回头了
走了就别回头了 2020-12-07 13:02

I need to execute ssh from windows command line by providing password in a non interactive manner. I could implement the key based authenti

5条回答
  •  醉话见心
    2020-12-07 13:40

    PowerShell solution

    Using Posh-SSH:

    New-SSHSession -ComputerName 0.0.0.0 -Credential $cred | Out-Null
    Invoke-SSHCommand -SessionId 1 -Command "nohup sleep 5 >> abs.log &" | Out-Null
    

提交回复
热议问题