To run a shell script in an encrypted mode


Scenario:  To encrypt a shell script for security reason and to call the encrypted shell script in another shell script.

Prerequisite for installing shc (encrypting a shell script):
Gcc library is required before installing shc application.

SHC installation in Centos:

Step1:  #yum install gcc

Step2: #yum install shc ( it will install shc.x86_64) based on the OS version.
Now steps to encrypt a shell script.

After the successful installation of SHC the following steps to be carried out.

Step3: create a shell script to display your login-id and the computer hostname.
Script1:
#!/bin/bash
Echo –n “I am logged on as”; whoami
Echo –n “ My computer name”; hostname
Save the file and close (:wq) - File name login.sh

Step4:  now run the command
#shc –f  login.sh
This will create two files a. login.sh.x b. login.sh.x.c

Step5:  Run the command to execute in another shell script
# shc –v  –r  -T –f  login.sh

Step 6: Create another script to call the encrypted script.
#!/bin/bash
PATH_TO_A=/root/login.sh.x
echo Calling sh login.sh.x
$PATH_TO_A

Step7:  Execute another script and check with the original one; both output must be similar.

An unexpected error occurred. Check that the server name is correct, that the server is on, that Citrix XenApp is installed on this server, and that the Citrix MFCOM Service is running.


Error Message:

An unexpected error occurred. Check that the server name is correct, that the server is on, that Citrix XenApp is installed on this server, and that the Citrix MFCOM Service is running.

Citrix-Error

 

 

 

 

 

 

 

 

 

Cause for this issue:

There are multiple possible causes for this issue.  Possible resolutions are given below.

Cause1: Network COM+ will not be installed or not enabled.

Solution: Install Network COM+ in the Windows2008 or 2003 roles.

Cause2: The user is not a member of the Distributed COM Users group on the server

Solution: Add the user to the BUILT-IN\Distributed COM Users group on the server you are connecting to. The recommendation is to do this using nested group, such as a Citrix Admins group.

The above solutions are the common points for this issue.

I still have the problem after doing the above configuration and also I got ODBC error in event viewer.

I also made an attempt to configure the ODBC FileDSN and give the file path of C:\Program Files (x86)\Citrix\Independent Management Architecture\MF20.dsn where the authentication fails.

Solution to my Problem:

In the windows services, select the service “Citrix Independent Management architecture” and give your user account or common user account in the logon as menu option which has admin privileges.

Do the same for Citrix WMI service where it is a dependent service for CIMA.

Restart that service and this helps me to overcome the above error.

Citirx-CIMA