Running commands remotely through SSH

This recipe shows you how to execute one-shot commands on a remote system through Secure Shell (SSH). Having the ability to run commands without establishing a full interactive session can be convenient because you can avoid running a second terminal; everything can be done directly from the same command line.

Getting ready

This recipe requires a remote system running the OpenSSH server and a local computer with the OpenSSH SSH client installed (both should be installed by default on CentOS). The examples assume that the remote system is configured with the IP address Also, you will need a user account available on the remote system.

How to do it...

The following examples show you how to run commands ...

Get CentOS 7 Server Deployment Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.