我在执行 scp 时出现以下错误,可能是什么原因?
[~/workspace/xr-dev/call-home/core/src] /usr/bin/scp myfile.c host2:/scratch/shirohua/
shirohua@host2's password:
usage: scp [-12346BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
[-l limit] [-o ssh_option] [-P port] [-S program]
[[user@]host1:]file1 ... [[user@]host2:]file2
lost connection
[~/workspace/xr-dev/call-home/core/src]
答案1
将本地文件复制到远程主机:
scp {{path/to/local_file}} {{remote_host}}:{{path/to/remote_file}}
尝试提供本地文件的完整路径
此外,请确保 /scratch/shirohua/ 存在