I am trying to write a simple script that will issue a command on a San switch and write the output to a text file.
I am using a SSH login via Plink. The authorisation process appears to complete ok but the command is not executed.
this is the plink script :-
plink -ssh -l Administrator -v 172.20.3.71 show port status > portst.txt
and this is the response I get :-
Looking up host "172.20.3.71"
Connecting to 172.20.3.71 port 22
Server version: SSH-2.0-McSSH-1.0
Using SSH protocol version 2
We claim version: SSH-2.0-PuTTY_Snapshot_2008_02_06:r
Using Diffie-Hellman with standard group "group1"
Doing Diffie-Hellman key exchange with hash SHA-1
Host key fingerprint is:
ssh-dss 512 d8:fc:32:f8:d8:6f:a5:fd:49:98:01:59:82:09
Initialised triple-DES CBC client->server encryption
Initialised HMAC-SHA1 client->server MAC algorithm
Initialised triple-DES CBC server->client encryption
Initialised HMAC-SHA1 server->client MAC algorithm
Using username "Administrator".
Opened channel for session
Server refused to start a shell/command
FATAL ERROR: Server refused to start a shell/command
Any ideas would be appreciated.
Tom thanks for your response.
Yes I have checked the CLI is enabled and I can logon to the switch manually through SSH and issue CLI commands.
I think the error I am getting is because the command is being issued before authorisation is complete. I can't get an SSH logon to accept a password so I presume I have to set up a pvt key but not sure how to do this and I'm struggling to find any documentation that shows me how. I can display the switch public key information and I can create a public & pvt key using Puttygen but thats as far as I have got so far.