我正在尝试自动化一个工作,其中包括通过shell脚本执行某些步骤,将几个文件通过"SCP"传输到远程机器,并在远程机器上触发一个shell脚本。
是否有一种使用shell脚本或其他脚本来完成此任务的方法?
提前感谢, cherryhitech
我正在尝试自动化一个工作,其中包括通过shell脚本执行某些步骤,将几个文件通过"SCP"传输到远程机器,并在远程机器上触发一个shell脚本。
是否有一种使用shell脚本或其他脚本来完成此任务的方法?
提前感谢, cherryhitech
$ scp some_files remote_host:some_directory/
$ ssh remote_host my_script
scp localfile remotehost:remotepath
ssh remotehost uname -r
或者
ssh remotehost /path/to/remote/script
remote-host
上运行remote-script.sh
:ssh user@remote-host ". remote-script.sh"
使用密钥认证:
ssh -i local/path/to/remote/key user@remote-host ". remote-script.sh"