{"id":561,"date":"2010-05-17T02:42:31","date_gmt":"2010-05-17T07:42:31","guid":{"rendered":"http:\/\/yourLinuxGuy.com\/?p=561"},"modified":"2010-05-17T18:47:19","modified_gmt":"2010-05-17T23:47:19","slug":"ifolder-3-8-change-local-user-password-script","status":"publish","type":"post","link":"https:\/\/yourLinuxGuy.com\/?p=561","title":{"rendered":"iFolder 3.8 Change Local User Password Script&#8230;"},"content":{"rendered":"<p>If you have an iFolder 3.8 (and some previous versions) server, and you use the local database (instead of LDAP or what-not), then you may have run into a situation where you have to change a password for a regular user when that current password is not known.<\/p>\n<p>Of course, if the user *knows* his or her own password, he or she can use the &#8220;settings&#8221; link in the iFolder Web Access page, or the &#8220;Security&#8221; menu item in the client interface.<\/p>\n<p>But if the password is <em>UN<\/em>known, then you really have no choice but to do it on the command line of the iFolder server.\u00a0 The problem with that, however, is that in order to do that on the command line, you&#8217;ll need to enter both the admin credentials and the user&#8217;s new credentials as well&#8230; which is never a good idea to do, since that will sit in the command history by default, etc.\u00a0 Besides, who wants to memorize that crazy string anyway?<\/p>\n<p>So, here&#8217;s a tiny little favor for you&#8230;\u00a0 I stuffed it all into a tiny little helper script that you can have.\u00a0 Just paste these contents into a script, do a chmod +x to make it executable, and away you go.\u00a0 it will prompt you for admin password, username to change, and the new password for that user.<\/p>\n<p>I hope it helps!\u00a0 Here you go&#8230;<\/p>\n<pre><code>#!\/bin\/bash\r\nclear\r\necho \"\"\r\necho \"This is the user password change tool for iF3...\"\r\necho \"\"\r\necho \"Please enter the admin password: \"\r\necho \"\"\r\nread ADMINPW\r\nclear\r\necho \"\"\r\necho \"Please enter the username for which you are changing the password: \"\r\necho \"\"\r\nread USERNAME\r\nclear\r\necho \"\"\r\necho \"Please enter the new password for $USERNAME (careful with crazy special characters): \"\r\necho \"\"\r\nread USERPW\r\nclear\r\necho \"\"\r\necho \"Processing...\"\r\necho \"\"\r\n# For 32 bit...\r\n\/usr\/bin\/mono \/usr\/lib\/simias\/bin\/UserCmd.exe setpwd --url http:\/\/localhost --admin-name admin --admin-password $ADMINPW --user $USERNAME --password $USERPW\r\n# For 64 bit...\r\n#\/usr\/bin\/mono \/usr\/lib64\/simias\/bin\/UserCmd.exe setpwd --url http:\/\/localhost --admin-name admin --admin-password $ADMINPW --user $USERNAME --password $USERPW\r\necho \"\"\r\n# I know the exit codes from mono are of no real value, but oh well...\r\nif [ \"$?\" -eq \"0\" ];then\r\necho \"If the exit message reads: \\\"Failed - Invalid admin credentials\\\", the password for $USERNAME was not changed. \"\r\necho \"If the exit message reads: \\\"SetPassord for $USERNAME - False\\\", then $USERNAME might not exist in the system. \"\r\necho \"If the exit message reads: \\\"SetPassord for $USERNAME - True\\\", then the password for $USERNAME is now changed!\"\r\nelse\r\necho \"...The script encountered a problem! Exiting...\"\r\nexit 0\r\nfi\r\necho \"\"\r\necho \"...Done!\"<\/code><\/pre>\n<p>\ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you have an iFolder 3.8 (and some previous versions) server, and you use the local database (instead of LDAP or what-not), then you may have run into a situation where you have to change a password for a regular&#8230;<br \/><a class=\"read-more-button\" href=\"https:\/\/yourLinuxGuy.com\/?p=561\">Read more<\/a><\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[35,11],"tags":[],"class_list":["post-561","post","type-post","status-publish","format-standard","hentry","category-ifolder3","category-intermediate"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pnjn1-93","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=\/wp\/v2\/posts\/561","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=561"}],"version-history":[{"count":7,"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=\/wp\/v2\/posts\/561\/revisions"}],"predecessor-version":[{"id":567,"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=\/wp\/v2\/posts\/561\/revisions\/567"}],"wp:attachment":[{"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=561"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=561"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yourLinuxGuy.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=561"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}