I want to ssh into a remote host and ping another IP from that host. However, with the following script, I am only able to ssh into that host.
#!/bin/sh sshpass -p <password> ssh -t -o StrictHostKeyChecking=no <username>@<remote host> /usr/sbin/ping <some IP>
Then, after existing from the remote host (back into my source host), the ping starts.
In other words, when my script is executed, a ssh connection is made into a remote host. Ping doesn't take place on THAT remote host. When I manually exit from the remote host, the ping starts again (from my original host).
How do I make it so that the ping starts from the remote host instead of the source host?