我知道如何通过sftp获取远程文件。
例如:
sftp root@10.0.0.1:/path/to/file.txt localfile.txt
我该如何将文件上传到远程服务器?
(我需要在我的Bash脚本中使用这个命令。)
我知道如何通过sftp获取远程文件。
例如:
sftp root@10.0.0.1:/path/to/file.txt localfile.txt
我该如何将文件上传到远程服务器?
(我需要在我的Bash脚本中使用这个命令。)
同时考虑使用SSH公钥/私钥,这可以避免您为自动文件交换输入密码。
您可以使用命令“ssh-keygen”生成这些密钥。
$ scp root@10.0.0.1:/path/to/file.txt localfile.txt