Reputation: 3632
I'm trying to write a bash script to automatically do stuff in clients machines in the network. But after the code
ssh -i ~/.ssh/key root@machine
The bash program just stops What can I do to send the command to the remote machine? Thanks
Upvotes: 0
Views: 166
Reputation: 798566
Same way as if you were invoking bash directly.
ssh ... somescriptontheserver.sh
ssh ... ls -lR /
ssh ... << EOF
ls -lR /
EOF
Upvotes: 3