CLI via SSH

This thread has been locked for further replies. You can start a new thread to share your ideas or ask questions.

CLI via SSH

This thread has been locked for further replies. You can start a new thread to share your ideas or ask questions.
CLI via SSH
CLI via SSH
2020-02-17 15:58:43
Hardware Version: V2
Firmware Version: 2.0.3 Build 20190509 Rel.36379(s)

I wonder if anyone can help me?

 

I want to use PUTTY from the command line to sign into the switch using SSH, this I can do with no problem. But, I want to use the -m switch to pass a series of commands to the switch, this I cannot do, the commands in the file are rejected. I have tried every variation I can think of but can't get it to work. What am I missing?

 

I hope I haven't missed something obvious!

 

Mark

  0      
  0      
#1
Options
7 Reply
Re:CLI via SSH
2020-02-18 06:38:57

@RevM 

 

I suggest you upload the picture, I still having  some doubt about your quesions.but I guess there are two reasons may cauise this issue:

1. There are something wrong with your Putty?

2. The TP-Link do not support the parameter that you typed.

  0  
  0  
#2
Options
Re:CLI via SSH
2020-02-18 09:30:59 - last edited 2020-02-18 09:49:08

Thanks for the reply.

On my windows 10 machine I am typing:

 

putty 192.168.10.188 -ssh -l admin -i d:\privkey.ppk

 

And I get a CLI window wherein I can enter commands.

 

But when I type:

 

putty 192.168.10.188 -ssh -l admin -i d:\privkey.ppk -m test.txt

 

(I've attached the test.txt file)

I get a windows message: "PuTTY Fatal Error: Remote side unexpectedly closed network connection" and the commands in the file have not been executed.

 

Thanks for your help.

File:
test.txtDownload
  0  
  0  
#3
Options
Re:CLI via SSH
2020-02-18 09:51:01 - last edited 2020-02-18 09:52:28

Quote from the PuTTY manual section 3.8.3.6 -m: read a remote command or script from a file:

 

With some servers (particularly Unix systems), you can even put multiple lines in this file and execute more than one command in sequence, or a whole shell script; but this is arguably an abuse, and cannot be expected to work on all servers. In particular, it is known not to work with certain ‘embedded’ servers, such as Cisco routers.

 

I think the same applies to TP-Link switches and other embedded systems using dropbear as the SSH server.

༺ 0100 1101 0010 10ཏ1 0010 0110 1010 1110 ༻
  0  
  0  
#4
Options
Re:CLI via SSH
2020-02-18 09:55:51
If this is the case it's a real pain! Is there another way I can pass a batch of commands to the switch to be executed sequentially?
  0  
  0  
#5
Options
Re:CLI via SSH
2020-02-18 11:34:27 - last edited 2020-02-18 12:07:06

@RevM 

I use not Putty, but Kitty with Scripting. It has Line delay for cisco-like switches. You can easily batch commands.

 

  0  
  0  
#6
Options
Re:CLI via SSH
2020-02-18 15:13:18
Thanks, that's brilliant. Works a treat. I would love to be able to run this from the command line ie. run kitty , login, run kitty script file, log out. Is this possible?
  0  
  0  
#7
Options
Re:CLI via SSH
2020-02-18 15:17:28

@RevM 

Maybe it is possible, but I do not know, how to do it :)

  0  
  0  
#8
Options

Information

Helpful: 0

Views: 3182

Replies: 7

Related Articles