Executing SSH Scripts Using Code Stream in Aria Automation

Introduction

In this blog, I’d like to share my personal experience executing SSH scripts via Code Stream pipelines in VMware Aria Automation.

What started as a simple SSH task became a deep-dive into Linux filesystem permissions, guest OS behavior, and debugging Code Stream pipeline failures. If you’ve ever hit a mysterious "permission denied" error in a seemingly simple script execution — this one's for you.


Objective

To execute an SSH script on a Linux VM using Code Stream pipelines in Aria Automation with proper authentication, connection, and elevated guest-level execution.


Success Criteria

  • Establish SSH connection from Code Stream pipeline to target Linux VM

  • Execute a custom shell script located on the guest

  • Handle and resolve permission errors at OS level

  • Complete pipeline execution successfully from Aria Automation


The Problem

My Code Stream pipeline was connecting successfully to the target VM and initiating the script execution. However, it kept failing with the following error:

Permission Denied:

/var/tmp/codestream/ssh_script/


The script path was generated internally by Aria Code Stream, but the execution permission was blocked on the guest.

I tested the same script manually using vRO's Run Program in Guest Workflow — it worked without any issue.


Root Cause

Linux, by default, mounts /var/tmp with noexec, which prevents execution of any scripts or binaries from that location.

🔒 The noexec flag is used to improve system security by preventing execution of unauthorized code in temporary directories.

So even though the file existed and was uploaded correctly, the pipeline failed at execution.


The Fix

To fix the issue, we updated the guest OS mount options for /var/tmp as follows:


mount -o remount,exec /var/tmp

✅ After this, the Code Stream pipeline was able to execute the SSH script successfully without any permission errors.


Flowchart: End-to-End Execution Process


+------------------------+ | Aria Code Stream | | Pipeline Starts | +-----------+------------+ | v +------------------------+ | SSH Task Authenticates | | to Target Linux VM | +-----------+------------+ | v +------------------------+ | Script Uploads to VM | | (Path: /var/tmp/...) | +-----------+------------+ | v +------------------------+ | Attempt to Execute | | → Permission Denied | +-----------+------------+ | v +-------------------------------+ | Remount /var/tmp with exec | | mount -o remount,exec /var/tmp | +-----------+-------------------+ | v +------------------------+ | Pipeline Executes OK | | Script Runs on Target | +------------------------+


Screenshots (Attach in Blog)



Pipeline Execution Failure


Pipeline Execution Success





Further Automation

If you need enhancements or additional automation features, feel free to reach out. Your feedback and suggestions are always welcome! HashtagForge 



Comments

Popular posts from this blog

Creating Snapshots for Unmanaged VMs in Aria Automation (vRealize Automation)

Bulk import security policies into Palo Alto Networks firewalls

Automating Tag Creation & Assignment to VMs with vRA + vRO