Skip to content

Instantly share code, notes, and snippets.

@oskarsh
Last active April 26, 2019 19:01
Show Gist options
  • Save oskarsh/91b5577749e185d9d0f28a7853eb7d89 to your computer and use it in GitHub Desktop.
Save oskarsh/91b5577749e185d9d0f28a7853eb7d89 to your computer and use it in GitHub Desktop.
[run commands on ssh machine] runs a command on a device connected with ssh and gets output
#definde ssh
ssh_connection="root@189.232.123.XX"
password="admin"
sshpass -p $password ssh $ssh_connection #":command here:"
#ls command
ssh_connection="root@189.232.123.XX"
password="admin"
command="ls"
sshpass -p $password ssh $ssh_connection $command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment