我可以通过putty(ssh)访问一些机器。 有时我需要在这些机器上运行脚本。有没有一种简单而安全的方法通过ssh连接将文件从我的电脑发送到机器?
答案 0 :(得分:2)
您可以使用scp
通过ssh复制文件:
scp local_file remote_machine:/target/location
您也可以通过ssh运行命令目录:
ssh remote_machine 'echo 1 > remote_file'
甚至连接到ssh然后继续远程:
cat local_file | ssh remote_machine 'cat > remote_file'