BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Nishant2000
Fluorite | Level 6

Hi All,

 

I am running below code but it fails with message “ERROR: Shell escape is not valid in this SAS session”.  This code basically via SAS/Connect connects to remote host and run X command.

 

When I run the same command via workspace Server(i.e. via SAS EG on local host) the code works. What I understood is it is becasue Connect Server starts with -NOXCMD option. 

 

I tried to make change from -NOXCMD to XCMD, by making changes in  sasv9_usermods.cfg and ConnectServer_usermods.sh but nothing works.

 

Please suggest. 

PS: XCMD is working fine for workspace server in remote and local, also permission of file is correct. And Connect Server is working fine as TCP connection is happening.

 

--> Code:

LIBNAME ADM00 BASE "Data/ETLA-System_Administrasjon/ADM.00_Common";
Option NOCONNECTMETACONNECTION ;

 

%LET TCPHOST = dc4coj  7552;
options remote=TCPHOST comamid=tcp;

signon TCPHOST user=sasftp pass="XXXX";

rsubmit TCPHOST;

 

data _null_;
command="df -g >/drift/logs/admin/ADM_DF_Disk_Usage_dc4coj.txt";
call system(command);
run;

 

endrsubmit;

signoff; 

 

--> Startup Script for Connect Server:

/local/apps/SAS94/config/Lev1/SASETL/ConnectServer/ConnectServer.sh -DMR -COMAMID TCP -NOXCMD -NOTERMINAL

 

--> Changes in sasv9_usermods.cfg and ConnectServer_usermods.sh

$  cat ConnectServer_usermods.sh

#!/bin/sh -p

#

# connectserver_usermods.sh

#

# This script extends connectserver.sh.  Add local environment variables

# to this file so they will be preserved.

#

 

USERMODS_OPTIONS=" -xcmd "

 

 

$ cat sasv9_usermods.cfg

-xcmd

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Nishant2000
Fluorite | Level 6

Hi,

 

Apologies for so delayed response, but it got solved. 

 

We had to do two things:

1) Add xcmd entry in connectserver.sh script

2) Add entry in connect spawner option for xcmd.

 

Followed below link

http://support.sas.com/kb/16/109.html 

View solution in original post

4 REPLIES 4
Nishant2000
Fluorite | Level 6

Hi,

 

 I checked in Meta environment there is no configuration for connect spawner, and as connect server is in compute layer the configuration looks to be fine. 

 

What exactly I need to check in metadata?

abhijit_das
Fluorite | Level 6

Please try updating ConnectSpawner_usermods.sh file in your compute tier. Add the following:

USERMODS_OPTIONS="JREOPTIONS -allowxcmd"

 

Restart Connect spwner and test.

 

regards,

Abhijit

Nishant2000
Fluorite | Level 6

Hi,

 

Apologies for so delayed response, but it got solved. 

 

We had to do two things:

1) Add xcmd entry in connectserver.sh script

2) Add entry in connect spawner option for xcmd.

 

Followed below link

http://support.sas.com/kb/16/109.html 

suga badge.PNGThe SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment. 

Join SUGA 

CLI in SAS Viya

Learn how to install the SAS Viya CLI and a few commands you may find useful in this video by SAS’ Darrell Barton.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 2749 views
  • 0 likes
  • 3 in conversation