Você precisa fazer:
root@debian:/home/mohsen# ssh [email protected] "~/test.sh"
[email protected]'s password:
What machine is sick ?192.168.1.4
1) Ping 192.168.1.4 3) Option 3
2) Option 2 4) Quit
Please enter your choice: 1
you chose to ping 192.168.1.4
PING 192.168.1.4 (192.168.1.4) 56(84) bytes of data.
64 bytes from 192.168.1.4: icmp_req=1 ttl=64 time=0.370 ms
--- 192.168.1.4 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.370/0.370/0.370/0.000 ms
Please enter your choice:
A sintaxe da execução remota é:
ssh account@remote_machin "command_for_run_on_remote_machine"
A sintaxe acima foi usada para fazer backup de sysadmins.