How to remotely execute shell commands on Linux devices using SureMDM Run Scripts?

SureMDM is a multi-platform,  an EMM solution that supports remote management of Linux devices. You can remotely execute Linux shell commands to perform variety of actions such as:

– Installing applications

– Creating and Deleting directory

– Creating and Deleting files

– Configuring  read/write/execute permissions to files

– moving files between folders

Executing Linux shell commands requires creating a Run Script job in SureMDM Web Console and applying it to the device. 


How to Create and Apply  a Run Script Job to a  Linux device?

To create and apply a Run Script Job, follow the below mentioned steps:

1. Login to SureMDM Web Console

SureMDM Login Screen

2. Click on Jobs

SureMDM Jobs

3. Click on New Job and then select OS as Linux

SureMDM Linux Option

4. Click on Run Script

5. On Run Script prompt, enter run scripts and click on Save

6. Go to SureMDM Home, select the desired Linux device and click on Apply

7. On Apply Job To Device prompt, select the job and click on Apply

(Note: All the Shell commands that support Linux can be used in SureMDM Run Script job as well.)


Here are some sample scripts which can be used to perform actions such as:

Linux Scripts

1. Create file


    cd /home/ubuntu

    cat >File.txt

2. Make directory:

    cd /home/ubuntu
    mkdir Folder_Name

3. Move file from one folder to other:

    cd /home/ubuntu
    mv Folder_1 Folder_2

4. Remove file (Example- TeamViewer):

    cd /home/ubuntu
    rm -r File_Name

5. To install the application:

    sudo sh -c "echo y | sudo apt-get -f install
    sudo sh -c "echo y | sudo apt-get install gdebi
    sudo wget
    sleep 10
    sudo sh -c "echo y | dpkg -i teamviewer_amd64.deb"
    sleep 5
    sudo apt-get install

6. Get Permission pop up to grant access for Remote support:



Run Script feature is supported on other OS platforms as well. To explore this feature for Android and iOS devices, click here.

For a free trial for SureMDM, register here.


Leave a Comment