KWLUG Ten SSH Tricks #7

3) Run remote shell commands

You don't have to open an interactive shell

     ssh user@host command

This can be used to automate commands:

     perl -e 'foreach $i (1 , 6 .. 12) {print `ssh server$i "w"`}'
  • note backticks: system call.

  • (See later about logging in without typing a password.)

<< Previous | Index | Next >> Copyright © 2002 Daniel Allen