Monday 15 June 2015

How to Execute commands on a remote Linux machine?

Execute commands on a remote Linux machine

  • The syntax for running a command or script on a remote server is:

ssh [USER]@[IP] [command or script]


  • Suppose you want to display the directory contents of /root of a remote host, you can run the following command in linux terminal:


[premal@ubunu]$ ssh root@198.168.2.156 ls -l /root
root@198.168.2.156 's password:
total 15

drwxr-xr-x. 2 root root 4096 Mar 12 00:05 device_drivers

drwxr-xr-x. 2 root root 4096 Mar 12 01:31 pthreads_ls

No comments: