{"id":26267,"date":"2018-09-06T12:22:25","date_gmt":"2018-09-06T17:22:25","guid":{"rendered":"http:\/\/www.multitech.net\/developer\/?page_id=26267"},"modified":"2018-09-07T13:54:10","modified_gmt":"2018-09-07T18:54:10","slug":"passwd","status":"publish","type":"page","link":"https:\/\/www.multitech.net\/developer\/software\/mtr-software\/mtr-api-reference\/command-table\/passwd\/","title":{"rendered":"passwd"},"content":{"rendered":"<p>This section shows an example using the\u00a0<strong>passwd<\/strong>\u00a0command and describes the steps to change or reset the password for an admin account. These steps include using the current password and username but also an ID (aasID).\u00a0 In order to do this, you must first login with current credentials and then communicate with the PAM (Pluggable Authentications Module) that is responsible for users and users&#8217; settings to make changes.<\/p>\n<p><strong>Note:<\/strong> communication with the PAM is based on question-answer format. You send a command and get a response. To change the password, use\u00a0<b>aasAnswer\u00a0<\/b>for both old and new password, username, and\u00a0<b>aasID <\/b>(a 30-character alphanumeric string provided after you request a password change, which is not the same as the token used to log in.) There is a timeout. If the interval between commands is too long, you must restart the process.<\/p>\n<p>1. Login into the system.<\/p>\n<pre class=\"brush:xml\"><a href=\"http:\/\/mail2.multitech.com:32224\/?dmVyPTEuMDAxJiZkOTE4YTIzOTI3NWQ0MjVkNj01QjkxMkIxMV8xNjcyOV8xMDcxMF8xJiZjZTIyMGVhZDY1MjEzYzg9MTMzMyYmdXJsPWh0dHBzJTNBJTJGJTJGMTkyJTJFMTY4JTJFMiUyRTElMkZhcGklMkZsb2dpbiUzRnVzZXJuYW1lJTNE\">https:\/\/192.168.2.1\/api\/login?username=<\/a><b>admin<\/b>&amp;password=<b>ganna!23<\/b>\r\n\r\n{\r\n\"code\" : 200,\r\n\"result\" : {\r\n\"address\" : \"192.168.2.107\",\r\n\"isipcuser\" : false,\r\n\"isremoteuser\" : false,\r\n\"permission\" : \"admin\",\r\n\"port\" : \"41373\",\r\n\"timestamp\" : \"12:21:19:196\",\r\n\"token\" : \"801BC4AFBCB465479EB91A1F9D6A0\",\r\n\"user\" : \"admin\"\r\n},\r\n\"status\" : \"success\"\r\n}<\/pre>\n<p>2. Execute the command below. You should get an &#8220;aasMsg&#8221; &#8220;<b>Changing password for admin<\/b>&#8221; . It means that you requested the system to change the password.\u00a0\u00a0Copy or write down the\u00a0<b>aasID <\/b>value as you must use it in the further commands.<\/p>\n<pre class=\"brush:xml\"><a href=\"https:\/\/192.168.2.1\/api\/command\/passwd?data=%7b\">https:\/\/192.168.2.1\/api\/command\/passwd?data={<\/a>\"username\":\"admin\"}&amp;method=POST\r\n\r\n{\r\n\"code\" : 200,\r\n\"result\" : {\r\n\"aasDone\" : false,\r\n\"aasID\" : \"<b>EF2F537A830EE66DBBAE5A695EC4EC<\/b>\",\r\n\"aasMsg\" : \"<b>Changing password for admin.<\/b>\",\r\n\"aasType\" : \"info\"\r\n},\r\n\"status\" : \"success\"\r\n}<\/pre>\n<p>3. In the command below specify the valid <strong>aasID<\/strong>\u00a0along with valid username and current password (<strong>aasAnswer<\/strong>).\u00a0\u00a0You should get a aasMsg\u00a0 value of <strong>Current password<\/strong> in the response.<\/p>\n<pre class=\"brush:xml\"><a href=\"https:\/\/192.168.2.1\/api\/command\/passwd?data=%7b\">https:\/\/192.168.2.1\/api\/command\/passwd?data={<\/a>\"username\":\"admin\",\"aasID\":\"<b>EF2F537A830EE66DBBAE5A695EC4EC<\/b>\",\"aasAnswer\":\"<b>ganna!23<\/b>\"}&amp;method=POST\r\n\r\n{\r\n\"code\" : 200,\r\n\"result\" : {\r\n\"aasDone\" : false,\r\n\"aasID\" : \"EF2F537A830EE66DBBAE5A695EC4EC\",\r\n\"aasMsg\" : \"<b>Current password: <\/b>\",\r\n\"aasType\" : \"question; input hide\"\r\n},\r\n\"status\" : \"success\"\r\n}<\/pre>\n<p>4.\u00a0 Execute the command below to send the current password. If everything is correct, you will get &#8220;<b>New password<\/b>&#8221; as a<strong>asMsg<\/strong>.<\/p>\n<pre class=\"brush:xml\"><a href=\"https:\/\/192.168.2.1\/api\/command\/passwd?data=%7b\">https:\/\/192.168.2.1\/api\/command\/passwd?data={<\/a>\"username\":\"admin\", \"aasID\": \"EF2F537A830EE66DBBAE5A695EC4EC\", \"aasAnswer\":\"ganna!23\"}&amp;method=POST\r\n\r\n{\r\n\"code\" : 200,\r\n\"result\" : {\r\n\"aasDone\" : false,\r\n\"aasID\" : \"EF2F537A830EE66DBBAE5A695EC4EC\",\r\n\"aasMsg\" : \"<b>New password:<\/b> \",\r\n\"aasType\" : \"question; input hide\"\r\n},\r\n\"status\" : \"success\"\r\n}<\/pre>\n<p>5. Execute the command below to enter a new password (<strong>AasAnswer<\/strong>). If everything is correct, you will see a message <strong>Retype new password<\/strong> in the response.<\/p>\n<pre class=\"brush:xml\"><a href=\"https:\/\/192.168.2.1\/api\/command\/passwd?data=%7b\">https:\/\/192.168.2.1\/api\/command\/passwd?data={<\/a>\"username\":\"admin\", \"aasID\": \"EF2F537A830EE66DBBAE5A695EC4EC\", \"aasAnswer\":\"<b>Admin123<\/b>\"}&amp;method=POST\r\n\r\n{\r\n\"code\" : 200,\r\n\"result\" : {\r\n\"aasDone\" : false,\r\n\"aasID\" : \"EF2F537A830EE66DBBAE5A695EC4EC\",\r\n\"aasMsg\" : \"<b>Retype new password:<\/b> \",\r\n\"aasType\" : \"question; input hide\"\r\n},\r\n\"status\" : \"success\"\r\n}<\/pre>\n<p>5. Execute the command again to retype the password. If everything is correct, you will see a <strong>Change password success!<\/strong> message.<\/p>\n<pre class=\"brush:xml\"><a href=\"https:\/\/192.168.2.1\/api\/command\/passwd?data=%7b\">https:\/\/192.168.2.1\/api\/command\/passwd?data={<\/a>\"username\":\"admin\", \"aasID\": \"EF2F537A830EE66DBBAE5A695EC4EC\", \"aasAnswer\":\"Admin123\"}&amp;method=POST\r\n\r\n{\r\n\"code\" : 200,\r\n\"result\" : {\r\n\"aasDone\" : true,\r\n\"aasID\" : \"EF2F537A830EE66DBBAE5A695EC4EC\",\r\n\"aasMsg\" : \"<b>Change password success!<\/b>\",\r\n\"aasType\" : \"info\"\r\n},\r\n\"status\" : \"success\"\r\n}<\/pre>\n<p>6. Now your password is changed and you can login using the new password:<\/p>\n<pre class=\"brush:xml\"><a href=\"http:\/\/mail2.multitech.com:32224\/?dmVyPTEuMDAxJiZkOTE4YTIzOTI3NWQ0MjVkNj01QjkxMkIxMV8xNjcyOV8xMDcxMF8xJiZjZTIyMGVhZDY1MjEzYzg9MTMzMyYmdXJsPWh0dHBzJTNBJTJGJTJGMTkyJTJFMTY4JTJFMiUyRTElMkZhcGklMkZsb2dpbiUzRnVzZXJuYW1lJTNEYWRtaW4lMjZhbXAlM0JwYXNzd29yZCUzRA==\">https:\/\/192.168.2.1\/api\/login?username=admin&amp;password=<\/a><b>Admin123<\/b>\r\n\r\n{\r\n\"code\" : 200,\r\n\"result\" : {\r\n\"address\" : \"192.168.2.107\",\r\n\"isipcuser\" : false,\r\n\"isremoteuser\" : false,\r\n\"permission\" : \"admin\",\r\n\"port\" : \"41373\",\r\n\"timestamp\" : \"12:21:19:196\",\r\n\"token\" : \"801BC4AFBCB465479EB91A1F9D6A0\",\r\n\"user\" : \"admin\"\r\n},\r\n\"status\" : \"success\"\r\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This section shows an example using the\u00a0passwd\u00a0command and describes the steps to change or reset the password for an admin account. These steps include using the current password and username but also an ID (aasID).\u00a0 In order to do this, you must first login with current credentials and then communicate with the PAM (Pluggable Authentications [&hellip;]<\/p>\n","protected":false},"author":1478,"featured_media":0,"parent":13134,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"class_list":["post-26267","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/26267","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/users\/1478"}],"replies":[{"embeddable":true,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/comments?post=26267"}],"version-history":[{"count":8,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/26267\/revisions"}],"predecessor-version":[{"id":26269,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/26267\/revisions\/26269"}],"up":[{"embeddable":true,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/13134"}],"wp:attachment":[{"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/media?parent=26267"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}