ubuntu 下非交互式执行远程shell命令

apt-get install sshpass

sshpass -p **your_password** ssh -o StrictHostKeyChecking=no "root@$ip" "du -sm /home/bone/ext_disk/splunk/var/lib"

 

参考:

https://www.cyberciti.biz/tips/linux-running-commands-on-a-remote-host.html

http://unix.stackexchange.com/questions/38737/ssh-login-with-clear-text-password-as-a-parameter

posted @ 2017-01-06 11:17  bonelee  阅读(927)  评论(0编辑  收藏  举报