Reputation: 29
I am writing a shell script that can connect to another remote machine and query the DB , write the result in a file and copy the file back to main machine. I am facing issue while connecting to DB. I am not understanding how to connect to the remote machine. I am using ssh root@DB_IP the then ORACLE query. But its always asking a password. How to provide both username and password while doing a ssh to the remote machine?
Upvotes: 0
Views: 275
Reputation: 687
You can do this by two ways:-
sshpass -p password ssh root@ip "sh run.sh "
Upvotes: 0