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
本文转自张昺华-sky博客园博客,原文链接:http://www.cnblogs.com/bonelee/p/6255579.html,如需转载请自行联系原作者