zer0stimulus
zer0stimulus

Reputation: 23676

Linux: Run a shell command remotely and print result

I want to create a script that runs shell commands on a remote Linux machine and print out the result. Some thing like a "run once" SSH. Or for those familiar with Android development, something like "adb shell". For example, I want to run "ls" on my remote machine and display the results on the local host.

Upvotes: 0

Views: 166

Answers (1)

Austin Phillips
Austin Phillips

Reputation: 15776

This is supported directly by ssh:

ssh [options] [user@]hostname [command]

eg

ssh user@host ls

If not command is given an interactive shell is usually run by default.

Upvotes: 2

Related Questions