Controllerless Networks

last person joined: yesterday 

Instant Mode - the controllerless Wi-Fi solution that's easy to set up, is loaded with security and smarts, and won't break your budget
Expand all | Collapse all

PERL script for SSH access to instant CLI not working

This thread has been viewed 6 times
  • 1.  PERL script for SSH access to instant CLI not working

    Posted Jun 12, 2017 01:11 PM

    Hello,

     

    I am trying to implement a PERL script to log into an IAP-215 to run CLI commands periodically.  However, I am running into some problems with this.  Our telnet script has been working fine, but really would prefer to use SSH.

     

    PC side:

    [1] Error : Received SSH_MSG_DISCONNECT: 33554432:Only cli connections are allowed to the AP

    [1] Error : Writing packet: error on socket (or connection closed): Operation now in progress

    [1] Error : Writing packet: error on socket (or connection closed): Operation now in progress

     

    In AP side:

    Jun  8 05:34:54 2017 192.168.4.30 <192.168.4.30 04:BD:88:CE:18:A2> sshd[14785]: Accepted password for admin from 192.168.4.1 port 33460 ssh2

    Jun  8 05:34:54 2017 192.168.4.30 <192.168.4.30 04:BD:88:CE:18:A2> sshd[14785]: Disconnecting: Only cli connections are allowed to the AP

     

    What can we do here?  Are there any other alternatives

    1. Python Paramiko  library,
    2. Or optimize the current python pexpect program
    3. Or use the linux ssh command in shell
    4. Or use putty
    5. Or use poco C++ library
    6. Or any other available open source methods

    ?



  • 2.  RE: PERL script for SSH access to instant CLI not working

    EMPLOYEE
    Posted Jun 13, 2017 05:13 AM

    I don't know your script, so need to guess based on what you write.

     

    It looks like your script tries to execute commands directly over ssh. That is not supported in the Instant AP. The only supported login method is that you start an interactive session and enter the command there.

    That is exactly how it must be done with telnet, as telnet does not allow direct execution of commands (there was rexec/rshell for that in the past; don't use it it is insecure, and for that reason replaced by SSH that has all in it).

     

    To make it more clear, for example if you want to run the 'show version' command, what you would do as normal user is login, see that there is a prompt, then type 'show version', and see what comes out. With SSH it is possible to skip the prompt part, and directly execute the command (instead of the shell that gives the command prompt). This makes scripting easier and is probably the method that your script prefers when running over ssh, but is not supported by the Instant AP.

     

    You will need to let your script check for the prompts and issue the commands just like it does on telnet.

     

     



  • 3.  RE: PERL script for SSH access to instant CLI not working
    Best Answer



  • 4.  RE: PERL script for SSH access to instant CLI not working

    Posted Jun 22, 2017 11:16 AM

    Does AirRecorder work only with controller based APs, or will it work with an IAP?

     

    Are there any limits on the what commands can be issued with AirRecorder?

     

    Regards,

    Zummarius



  • 5.  RE: PERL script for SSH access to instant CLI not working

    EMPLOYEE
    Posted Jun 22, 2017 11:29 AM

    Airecorder will work with either controller-based or Instant APs.

     

    There is no limit to the commands that can be run.