Start a Conversation

This post is more than 5 years old

Solved!

Go to Solution

5335

March 15th, 2018 04:00

Scripting in Unity shell

Hi Folks,

I am trying to create a shell script for security baseline automation in unity, obviously need to use ssh keys instead of sending the credentials.

whenever i try to login with remote ssh and try to execute the command , i am getting this below error

[2261@abcds3 ~]$ ssh service@10.xx.xx.xx svc_nas ALL

-bash: line 2: svc_nas: command not found

In VNX, we have an option use NAS_DB before executing the unique commands of VNX like NAS_DB=/nas /nas/bin/server_log server_2 .

Do we have anything similar to that in unity to execute svc_nas commands via scirpting?

8.6K Posts

March 15th, 2018 06:00

just do an alias "svc_nas"

then you'll see that its actually just an alias for "sudo svc_nas"

and the real svc_nas is located in /EMC/Platform/bin/

1 Rookie

 • 

108 Posts

March 15th, 2018 08:00

Thanks Much, aliases worked I could able to retrieve the information needed.

1 Message

June 20th, 2019 07:00

I am trying to run SVC_NAS in a script as well but how do you use the alias to execute the command.  

 

Thank you. 

1 Message

June 21st, 2019 15:00

I'm not sure you can. If you look at the previous replies use the full command sudo /EMC/Platform/bin/svc_command...

In my scripts, perl usually, I create my own variable in the form of $_svc="sudo /EMC/Platform/bin/"

Then depending on sub routine / command I was to call i concatenate $_svc."svc_cifssupport ".$ns." -acl -path \/".$fs as an example using variables for nas server and fs in this example. I use this method primarily to execute commands over SSH and you need the full sudo path to do this. 

As an fyi this still seems to work in 4.5.1 with rBash but I found I need to run a routine to disable rBash for my auto ssh_key setup to work if for some reason the auth keys no longer work. 

Hope this helps - McK

 

7 Posts

May 20th, 2020 08:00

Couple of quick questions. I'm programming in Python, and I'm collecting the data - or trying to - using ssh and the service account.

ssh $mgmt -l service  "sudo /EMC/Platform/bin/svc_nas ALL -param -facility -all -info -all"

1. How do you disable rbash?

2. How do you setup the ssh keys so i'm not prompted for a password? I know regular UNIX style environments, but Unity seems to be a special case.

I'm collecting against multiple arrays on  daily basis, so this runs through a loop and collects for each one, parses the info and then puts it all together for the customer to see in a nice email and spreadsheet. 

Thanks for any help.

No Events found!

Top