1、ssh第一次登录远程主机时,必须先用ssh username@ip的方式成功登录; 2、接下来可以使用如下脚本内容登录远程主机: sshpass -p password ssh username@ip