【发布时间】:2012-11-11 16:31:05
【问题描述】:
我想自动化我的支持工作。我想制作一个脚本,它将连接到服务器并在服务器上执行一些 CRUD 操作,然后再次返回到本地计算机。我不想上传脚本。到目前为止,我已经制作了一个有助于连接服务器的脚本,但我无法通过它进行任何其他操作。是否可以在远程服务器上运行本地脚本?
我的脚本:
!/usr/bin/expect
set ip neviss
set user user
set password 1234
spawn ssh "$user\@$ip"
expect "Password:"
send "$password\r";
interact ( after this line any command is not getting executed)
ls -lrt
【问题讨论】: