1. 远程执行Shell命令
$ssh [user]@[server] '[command]'
#eg. ssh root@192.168.1.1 'uptime'
2. 远程执行Shell本地脚本
$ssh [user]@[server] 'bash -s' < [local_script]
#eg. ssh root@192.168.1.10 'bash -s' < local_script.sh
#
1. 远程执行Shell命令
$ssh [user]@[server] '[command]'
#eg. ssh root@192.168.1.1 'uptime'
2. 远程执行Shell本地脚本
$ssh [user]@[server] 'bash -s' < [local_script]
#eg. ssh root@192.168.1.10 'bash -s' < local_script.sh
#
本文标题:Linux远程执行Shell命令或脚本
本文链接:https://www.haomeiwen.com/subject/mtwqkqtx.html
网友评论