Page 1 of 1

axis root password at first boot - curl request

Posted: Sat Oct 30, 2010 8:33 pm
by hornetbzz
Hi

I'm looking how to shell script for changing the root password at boot, but no success till now.

I can manage to change it once the first password has been set up but not at the first boot time. (both ways are working: using cgi vapix in a curl request or directly through curl in the shell)

Could anybody give a hint about the right curl request for this please ?

Thx in advance

----------------------------------
Here is what I tried w/o success :

Code: Select all

echo "Changing root default password : "
USER="root"
PASSWORD="new_pwd"
# GET from pwdroot/pwdRoot.shtml
# ="submitdata=action?update&user=$USER&pwd=$PASSWORD&dummy="
# POST="dummy=&user=$USER&pwd=$PASSWORD&pwd_confirm=$PASSWORD"
#POST="user=$USER&pwd=$PASSWORD&dummy="
#POST="user=$USER&pwd=$PASSWORD&pwd_confirm=$PASSWORD&dummy="
POST="submitdata=action?update&user=$USER&pwd=$PASSWORD&dummy="
URL="pwdroot/pwdRoot.shtml"
curl --data "$POST" http://my_cam_lan_ip/"$URL"
I also tried straight in the browser :

Code: Select all

http://my_cam_lan_ip/axis-cgi/pwdroot/pwdroot.cgi?action=update&user=root&pwd=test2&return_page=/
This way showed at the mean time that there is a small bug in the axis cgi script as I could connect to the axis live view despite the root password has not been reset, but this is another story.

Posted: Sun Oct 31, 2010 1:37 am
by hornetbzz
I got it solved.

I digged a bit more into the cgi scripts code and it looks like that the pwdroot.cgi script is awaiting a GET request when I was trying to send it with the POST (curl --data ..) :roll:


So the correct way for this curl request is :

Code: Select all

curl "http://my_cam_lan_ip/axis-cgi/pwdroot/pwdroot.cgi?action=update&user=$USER&pwd=$PASSWORD&return_page=/"
It works in my model case (axis 207MW)