Unix 使用非交互式SSH登录删除文件
我正在尝试使用Unix 使用非交互式SSH登录删除文件,unix,ssh,sshpass,Unix,Ssh,Sshpass,我正在尝试使用sshpass从服务器远程删除文件 使用常规的ssh很好: ssh username@ip rm -f fullpath/file.txt username@ip's password: **** 但是当我尝试使用sshpass时: sshpass -p 'password' username@ip rm -f fullpath/file.txt server answer: sshpass: Failed to run command: No such file or dir
sshpass
从服务器远程删除文件
使用常规的ssh
很好:
ssh username@ip rm -f fullpath/file.txt
username@ip's password: ****
但是当我尝试使用sshpass
时:
sshpass -p 'password' username@ip rm -f fullpath/file.txt
server answer: sshpass: Failed to run command: No such file or directory
我错过了什么???找到了
sshpass-p“password”sshusername@iprm-f fullpath/file.txt
为什么不使用公钥?