{"id":3486,"date":"2020-07-06T11:40:55","date_gmt":"2020-07-06T16:40:55","guid":{"rendered":"http:\/\/www.incredigeek.com\/home\/?p=3486"},"modified":"2020-07-06T11:42:35","modified_gmt":"2020-07-06T16:42:35","slug":"change-unifi-camera-password-from-command-line","status":"publish","type":"post","link":"https:\/\/www.incredigeek.com\/home\/change-unifi-camera-password-from-command-line\/","title":{"rendered":"Change UniFi Camera Password from Command Line"},"content":{"rendered":"\n<p>Basic steps are<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Change password with passwd<\/li><li>Copy passwd hash to \/tmp\/system.cfg<\/li><li>Apply Changes<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Changing Password with passwd<\/h2>\n\n\n\n<p>The passwd command is normally used for changing the password for a Linux user.  We&#8217;ll use it to change our user password and then copy the hash out of the \/etc\/passwd file to use in the Ubiquiti config file.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">UVC.v4.18.37.67# passwd\nChanging password for admin\nNew password:\nRetype password:\npasswd: password for admin changed by admin\nUVC.v4.18.37.67#<\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Copy passwd hash to \/tmp\/system.cfg<\/h2>\n\n\n\n<p>Using &#8220;cat \/etc\/passwd&#8221;, we can get what the new password hash is and can copy that into the \/tmp\/system.cfg file.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">UVC.v4.18.37.67# cat \/etc\/passwd\nadmin:<strong>$6$K4VfN1jGcxaX63Eo$yMGBg7jgCCg.HorkmkQf9wnQcEko.1onZcAa6ua421LonYgfYr8FgHprrwkMqaTYzH0KqCtOEPqDlB3AvkvcW.<\/strong>:0:0:Administrator:\/etc\/persistent:\/bin\/sh\nUVC.v4.18.37.67#<\/pre>\n\n\n\n<p>Open up the \/tmp\/system.cfg config file, find the section below and replace the hash part, i.e. the part that is in bold.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">users.1.name=admin<strong>\n<\/strong>users.1.password=<strong>$6$K4VfN1jGcxaX63Eo$yMGBg7jgCCg.HorkmkQf9wnQcEko.1onZcAa6ua421LonYgfYr8FgHprrwkMqaTYzH0KqCtOEPqDlB3AvkvcW.<\/strong>\nusers.1.status=1<\/pre>\n\n\n\n<p><em>As a side note, you can copy and past all of the &#8220;users.1.*&#8221; lines and change the 1 to 2 and have a second user.<\/em><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Apply Changes<\/h2>\n\n\n\n<p>You can use the following command to write the changes and then reboot the camera.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cfgmtd -f \/tmp\/system.cfg -w &amp;&amp; reboot<\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Long Example<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">[admin@localhost ~]$ ssh ubnt@10.96.1.91\nubnt@10.96.1.91's password:\nBusyBox v1.29.2 () built-in shell (ash)\nUVC.v4.18.37.67# passwd\nChanging password for admin\nNew password:\nRetype password:\npasswd: password for admin changed by admin\nUVC.v4.18.37.67# cat \/etc\/passwd\nadmin:$6$K4VfN1jGcxaX63Eo$yMGBg7jgCCg.HorkmkQf9wnQcEko.1onZcAa6ua421LonYgfYr8FgHprrwkMqaTYzH0KqCtOEPqDlB3AvkvcW.:0:0:Administrator:\/etc\/persistent:\/bin\/sh\nUVC.v4.18.37.67# vi \/tmp\/system.cfg <strong>&lt;- Edit the text file and replace the hash with the one from above<\/strong>\nUVC.v4.18.37.67# cfgmtd -f \/tmp\/system.cfg -w &amp;&amp; reboot<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Basic steps are Change password with passwd Copy passwd hash to \/tmp\/system.cfg Apply Changes Changing Password with passwd The passwd command is normally used for changing the password for a Linux user. We&#8217;ll use it to change our user password &hellip; <a href=\"https:\/\/www.incredigeek.com\/home\/change-unifi-camera-password-from-command-line\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[129,370],"tags":[131,132,974],"class_list":["post-3486","post","type-post","status-publish","format-standard","hentry","category-ubiquiti","category-unifi-video","tag-ubiquiti-2","tag-ubnt","tag-ui"],"_links":{"self":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/3486","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/comments?post=3486"}],"version-history":[{"count":7,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/3486\/revisions"}],"predecessor-version":[{"id":3493,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/3486\/revisions\/3493"}],"wp:attachment":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/media?parent=3486"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/categories?post=3486"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/tags?post=3486"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}