当前位置: 代码迷 >> 综合 >> shell通过sshpass远程ssh执行命令
  详细解决方案

shell通过sshpass远程ssh执行命令

热度:7   发布时间:2024-02-28 01:08:31.0

#先安装sshpass

yum install sshpass

#执行

sshpass -p yourpassword ssh root@192.1.1.118 "ls"

 

基本用法:sshpass -p [密码] ssh [user]@[host]

  相关解决方案