Linux 通过shell脚本传递scp的密码

Linux 通过shell脚本传递scp的密码,linux,shell,unix,scp,Linux,Shell,Unix,Scp,我有一个shell脚本,其中包含以下命令,用于将test.dat文件从远程服务器复制到我的当前目录: scp remote_user_id@remote_server_name:<filepath>/test.dat . scp远程用户_id@remote_server_name:/test.dat。 在执行脚本时,它要求输入我必须手动输入的密码。我没有安装或使用sshpass的权限,也没有设置ssh的权限。如何在shell脚本中传递此密码 使用公钥身份验证 选择从中读取公钥身份

我有一个shell脚本,其中包含以下命令,用于将test.dat文件从远程服务器复制到我的当前目录:

scp remote_user_id@remote_server_name:<filepath>/test.dat .
scp远程用户_id@remote_server_name:/test.dat。

在执行脚本时,它要求输入我必须手动输入的密码。我没有安装或使用sshpass的权限,也没有设置ssh的权限。如何在shell脚本中传递此密码

使用公钥身份验证

选择从中读取公钥身份验证的标识(私钥)的文件。此选项直接传递给ssh(1)

您也可以使用rsync。rsync的选项有--password file

可能与
 -i identity_file