{"id":348,"date":"2012-10-16T16:26:53","date_gmt":"2012-10-16T14:26:53","guid":{"rendered":"http:\/\/www.ub.edu\/tecnicweb\/?p=348"},"modified":"2013-12-05T12:46:18","modified_gmt":"2013-12-05T11:46:18","slug":"generacio-de-fitxers-de-contrasenyes","status":"publish","type":"post","link":"https:\/\/www.ub.edu\/tecnicweb\/generacio-de-fitxers-de-contrasenyes\/","title":{"rendered":"Generaci\u00f3 de fitxers de contrasenyes"},"content":{"rendered":"<p>\u00c9s possible restringir l&#8217;acc\u00e9s als vostres continguts web mitjan\u00e7ant codi i contrasenya, de manera que nom\u00e9s aquells que tinguin un codi i contrasenya correcte podran veure&#8217;ls (sempre des del navegador).<br \/>\nLa protecci\u00f3 es basa en els fitxers .htaccess.<br \/>\nJunt amb el fitxer .htaccess heu de tenir un fitxer que cont\u00e9 els codis i contrasenyes que podran accedir al contingut del directori on poseu aquest fitxers i subdirectoris.<br \/>\nAquest fitxer de contrasenyes s&#8217;ha de crear amb la utilitat <a href=\"https:\/\/www.ub.edu\/tecnicweb\/wp-content\/uploads\/2012\/10\/htpasswd.exe\">htpasswd (versi\u00f3 DOS\/Windows)<\/a><\/p>\n<h3>Com funciona htpasswd.exe ?<\/h3>\n<p>Per executar-ho heu d&#8217;obrir una finestra de \u00abS\u00edmbol del sistema\u00bb (inicio\/ ejecutar \/cmd)<\/p>\n<p><span style=\"text-decoration: underline;\"><strong>Crear fitxer<\/strong><\/span><br \/>\nhtpasswd -c nomFitxer<br \/>\nCrea el fitxer nomFitxer (pot ser el nom que vulgueu, per exemple password.pw) buit, sense cap codi ni contrasenya. Si aquest fitxer ja existia, el sobreescriu i es perd l&#8217;anterior.<br \/>\nExemple: htpasswd -c password.pw<\/p>\n<p><span style=\"text-decoration: underline;\"><strong>Afegir un usuari al fitxer<\/strong><\/span><br \/>\nhtpasswd -b nomFitxer codiUsuari contrasenyaUsuari<br \/>\nAfegeig un usuari al fitxer ja creat (nomFitxer). Atenci\u00f3: aquest fitxer ha d&#8217;existir anteriorment.<br \/>\nExemple: htpasswd -b password.pw maria 1234<br \/>\nAix\u00f3 afegeix al fitxer ja existent password.pw l&#8217;usuari maria amb la contrasenya 1234.<\/p>\n<p><span style=\"text-decoration: underline;\"><strong>Crear fitxer i afegir un usuari<\/strong><\/span><br \/>\nhtpasswd -cb nomFitxer codiUsuari contrasenyaUsuari<br \/>\nCrea el fitxer nomFitxer (pot ser el nom que vulgueu, per exemple password.pw) amb el codiUsuari i contrasenya especificats. Si aquest fitxer ja existia, el sobreescriu i es perd l&#8217;anterior.<br \/>\nExemple: htpasswd -cb password.pw maria 1234<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u00c9s possible restringir l&#8217;acc\u00e9s als vostres continguts web mitjan\u00e7ant codi i contrasenya, de manera que nom\u00e9s aquells que tinguin un codi i contrasenya correcte podran veure&#8217;ls (sempre des del navegador). La protecci\u00f3 es basa en els fitxers .htaccess. Junt amb el fitxer .htaccess heu de tenir un fitxer que cont\u00e9 els codis i contrasenyes que [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[44],"tags":[12,21],"class_list":["post-348","post","type-post","status-publish","format-standard","hentry","category-ajuda","tag-apache","tag-proteccio-directoris"],"_links":{"self":[{"href":"https:\/\/www.ub.edu\/tecnicweb\/wp-json\/wp\/v2\/posts\/348","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ub.edu\/tecnicweb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ub.edu\/tecnicweb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ub.edu\/tecnicweb\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ub.edu\/tecnicweb\/wp-json\/wp\/v2\/comments?post=348"}],"version-history":[{"count":5,"href":"https:\/\/www.ub.edu\/tecnicweb\/wp-json\/wp\/v2\/posts\/348\/revisions"}],"predecessor-version":[{"id":663,"href":"https:\/\/www.ub.edu\/tecnicweb\/wp-json\/wp\/v2\/posts\/348\/revisions\/663"}],"wp:attachment":[{"href":"https:\/\/www.ub.edu\/tecnicweb\/wp-json\/wp\/v2\/media?parent=348"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ub.edu\/tecnicweb\/wp-json\/wp\/v2\/categories?post=348"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ub.edu\/tecnicweb\/wp-json\/wp\/v2\/tags?post=348"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}