Cisco Support Community
Community Member

[WAP321]Need help with a Script for changing the wlan0 password

Hello experts

We recently bought 15 WAP321 units to build a Wireless Network in our company and because security is important to us, we wanted to change the Password of the wlan0 interface every week over SSH. Sounds easy and is easy when you get used to the new CLI.

First task is to enable the SSH support over the Web-GUI.

Second task is to find the right command, in my case it is :set interface wlan0 wpa-personal-key "password"

So far so good, but now comes the tricky part, script it on Windows with a Command Line SSH Client.

I love Putty, but it is not CMD based, so why not take plink ?

After I succesfully loged in, changed the wlan0 password without any errors and could confirm it changed, I wanted it to work with just 1 command.

My CMD is this: plink.exe -l user -pw password set interface wlan0 wpa-personal-key "password"

This should work as intended, but it does not and gives me the following:

set interface wlan0 wpa-personal-key "password": cannot open

Now I thought, ok lets try other SSH clients even those who are not purly CMD based, but i cannot solve this problem with any SSH Client, every client gives me the same error.

Maybe i can give plink a script file with -m script.txt but it didnt work either!

After some search I found this in the Putty/plink documentation:

The -m option performs a similar function to the ‘Remote command’ box in the SSH panel of the PuTTY configuration box (see section 4.18.1). However, the -m option expects to be given a local file name, and it will read a command from that 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.

Can anyone help me? Cisco Support? A Developer?

I need a workaround or a fix for this, or a reason why this is not possible or what I do wrong.

Best wish

Fabian Schwarz

Everyone's tags (7)
CreatePlease to create content