Home | About Me
| | | | | | | | | |

Execute command remotely using SSH

Dev Ops | 08 Apr 2015
Tags: terminal, shell, commands


If you are accessing your SSH using public key authentication:

sudo ssh -i key.pem ubuntu@host 'command to be executed remotely' ;

If you are accessing your SSH using username and password:

sudo ssh -u root -p ubuntu@host 'command to be executed remotely' ;