I wrote a script which downloads via
scp and installs some packages. SSH keys are added to host and when I run
[root@HostB ~]# ./myscript
everything is ok and packages are downloaded via scp without asking for password.
I need to run this script via
ssh but when I try
[root@HostA ~]# ssh root@HostB "./myscript"
I get Permission denied (publickey,password) error.
When I'm trying to use
ssh -t I get a password enquiry in place when
scp command in myscript is executing.