BlueXP Services

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

Rutul
6,977 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
admin@10.216.50.25's password:
NetApp ssh: ssh remote command is not allowed.
[root@GTheGandalf ~]#

4 REPLIES 4

chriswong
6,855 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
6,747 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
6,741 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 admin@10.216.50.25<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
5,594 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