I want to connect from ServerA to ServerB , and check Oracle Database Status and PendingLogs then record results, and use the result on ServerA ,and compare with the result on serverA and generate logs on serverA.I used ssh -q root@192.168.11.131 sh -s < /root/script.sh > /root/output.txtbut I still have to enter password manually. is there any way to turn off interactive login?how can I run script file via spawn ssh?
run script remotely and use result locally with ssh auto login
ssh;scripting;remote;file copy;autologin
1- is there any way to turn off interactive login?Yes, use public key authentication or sshpass to enter password.2- how can I run script file via spawn ssh ?Yes, use expect script. If you want to run some other script inside (awk), you need to escape the special characters (\$).