scp -i ~/.ssh/id_rsa.pub events*$date*_QA.log $remote_user@$remote_server:$remote_location
Run Code Online (Sandbox Code Playgroud)
上面的脚本不正确吗?我做得不对吗?
我去了.ssh目录,看到远程服务器在known_hosts文件中。
但是,当我做没有任何文件作为参数的普通 scp 时,它仍然要求输入密码
scp events*$date*_QA.log $remote_user@$remote_server:$remote_location
Run Code Online (Sandbox Code Playgroud)
如何在我的命令中包含密钥文件?
sh-3.2$ grep server ~/.ssh/*
/home/user/.ssh/known_hosts:server....com,ip_addr ssh-rsa Asine=jhjsdhfjsadhfjkashdfjhasdjfhksadjfhasjdfhj
Run Code Online (Sandbox Code Playgroud)
whi*_*ark 73
-i identity_file
Selects the file from which the identity (private key) for public
key authentication is read. This option is directly passed to
ssh(1).
Run Code Online (Sandbox Code Playgroud)
使用~/.ssh/id_rsa.
| 归档时间: |
|
| 查看次数: |
190547 次 |
| 最近记录: |