{"id":354,"date":"2018-10-28T11:00:30","date_gmt":"2018-10-28T11:00:30","guid":{"rendered":"https:\/\/nmbm.biz\/sitio\/?p=354"},"modified":"2018-10-28T12:44:15","modified_gmt":"2018-10-28T12:44:15","slug":"rsync-sem-digitar-senha","status":"publish","type":"post","link":"https:\/\/blog.webgescom.pt\/blog\/rsync-sem-digitar-senha\/","title":{"rendered":"Linux rsync sem digitar senha"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><em>adaptado de<\/em> <a href=\"https:\/\/ubuntuforums.org\/showthread.php?t=238672\">https:\/\/ubuntuforums.org\/showthread.php?t=238672<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">O comando rsync \u00e9 uma ferramenta poderos\u00edssima para sincroniza\u00e7\u00e3o de pastas e ficheiros em sistemas Linux. Utilizo-o frequentemente para opera\u00e7\u00f5es de backup de dados. No entanto, a sua utiliza\u00e7\u00e3o, pressup\u00f5e a autentica\u00e7\u00e3o do utilizador, pelo que teremos de criar um mecanismo de autentica\u00e7\u00e3o na m\u00e1quina remota, sem necessidade de ter de digitar sempre a palavra-passe. Eliminando esta obriga\u00e7\u00e3o, podemos programar tarefas de sincroniza\u00e7\u00e3o, sem necessidade da nossa presen\u00e7a. O mecanismo a que recorremos \u00e9 a cria\u00e7\u00e3o de uma chave p\u00fablica da nossa identidade no nosso sistema e copia-la, em seguida, para o sistema remoto.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Em primeiro lugar, vamos criar uma chave p\u00fablica:\n<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ssh-keygen -t rsa<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Em seguida, vamos copiar para o sistema remoto:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ssh-copy-id -i ~\/.ssh\/id_rsa.pub utilizador@computador_remoto<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Agora pode testar a liga\u00e7\u00e3o, executando:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ssh utilizador@computador_remoto<\/pre>\n<div class=\"pvc_clear\"><\/div><p id=\"pvc_stats_354\" class=\"pvc_stats all  \" data-element-id=\"354\" style=\"\"><i class=\"pvc-stats-icon small\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/blog.webgescom.pt\/blog\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p><div class=\"pvc_clear\"><\/div>","protected":false},"excerpt":{"rendered":"<p>O comando rsync \u00e9 uma ferramenta poderos\u00edssima para sincroniza\u00e7\u00e3o de pastas e ficheiros em sistemas Linux<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_354\" class=\"pvc_stats all  \" data-element-id=\"354\" style=\"\"><i class=\"pvc-stats-icon small\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/blog.webgescom.pt\/blog\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"author":1,"featured_media":363,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","footnotes":""},"categories":[9],"tags":[82,81],"class_list":["post-354","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","tag-backup-dados","tag-rsync"],"aioseo_notices":[],"a3_pvc":{"activated":true,"total_views":1348,"today_views":0},"_links":{"self":[{"href":"https:\/\/blog.webgescom.pt\/blog\/wp-json\/wp\/v2\/posts\/354","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.webgescom.pt\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.webgescom.pt\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.webgescom.pt\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.webgescom.pt\/blog\/wp-json\/wp\/v2\/comments?post=354"}],"version-history":[{"count":6,"href":"https:\/\/blog.webgescom.pt\/blog\/wp-json\/wp\/v2\/posts\/354\/revisions"}],"predecessor-version":[{"id":362,"href":"https:\/\/blog.webgescom.pt\/blog\/wp-json\/wp\/v2\/posts\/354\/revisions\/362"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.webgescom.pt\/blog\/wp-json\/wp\/v2\/media\/363"}],"wp:attachment":[{"href":"https:\/\/blog.webgescom.pt\/blog\/wp-json\/wp\/v2\/media?parent=354"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.webgescom.pt\/blog\/wp-json\/wp\/v2\/categories?post=354"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.webgescom.pt\/blog\/wp-json\/wp\/v2\/tags?post=354"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}