NetApp Community Update
This site will enter Read Only mode on July 23 as we prepare to move to a new platform. You will still be able to view content, but posting and replying will be temporarily disabled.
We're excited to launch our new Community experience on July 30 and more information will follow soon.
Stay connected during the transition - Join our Discord community today.

NetApp Console

Need remote access to Altavault using script.Unable to run ssh commands from script on Altavault

Rutul
9,504 Views

Hi All,

 

I am trying to implement the script to copy or transfer dump or config files from altavault to another location. I am able to login to the altavault from linux machine using ssh command.But when I try to ssh to connect to altavault using script it is giving error as "ssh remote command is not allowed ". Please guide or show the way to get access and ssh login to altavault using script.

 


Script:
#!/bin/bash
USERNAME="admin"
HOST="10.216.50.25"
ssh -o StrictHostKeyChecking=no -l $USERNAME $HOST "pwd; ls"

 

Execution on Linux machine:
[root@GTheGandalf ~]# ./slogin.sh
NetApp SteelStore
[email protected]'s password:
NetApp ssh: ssh remote command is not allowed.
[root@GTheGandalf ~]#

4 REPLIES 4

chriswong
9,382 Views

Hi,

Please take a look at the AltaVault CLI guide, which can help address your question. I'll take a further look and get back to you if I find anything else.

http://mysupport.netapp.com/documentation/docweb/index.html?productID=62033&language=en-US

 

Regards,

Christopher

chriswong
9,274 Views

I discussed this topic further, and the expectation is you should be able to use advanced scripting (expect, perl, python, etc) to accomplish this. There shouldn't be any reason that the SSH session should not be allowed assuming the script awaits response, and then responds accordingly.


Regards,

Christopher

Rutul
9,268 Views

Hi Chris,

 

I already tried the all languages. I found on some riverbed steelstore community that in some versions there is a restriction to .I am not sure wether it is right or not.Anyway I already found the work around.We can execute ssh commands from script if we keep all commands of altavault in one text file and then execute that text file from script then we are able to get the result.

 

 

Solution Example :

 

#!/usr/bin/perl

$cli ='ssh [email protected]<sh.txt';

$execute=`$cli`;

print $execute;

 

 

sh.txt file will contain commands of altavault which you want to execute from remote machine.....

 

This was executed successfully with result.

 

Thanks,

Rutul 

tcm10
8,121 Views

Rutul,

 

A here document has worked well for me:

 

#!/bin/bash

host="altavaulthostname"

ssh -tt -l admin ${host} << EOF 2>/dev/null
en
show version all
show info
exit
EOF


 

Public