{"id":1075,"date":"2022-09-09T18:15:03","date_gmt":"2022-09-09T16:15:03","guid":{"rendered":"https:\/\/alessandromasciadri.com\/?p=1075"},"modified":"2022-09-09T18:35:25","modified_gmt":"2022-09-09T16:35:25","slug":"come-caricare-file-via-scp-da-una-macchina-locale-ad-una-remota","status":"publish","type":"post","link":"https:\/\/alessandromasciadri.com\/come-caricare-file-via-scp-da-una-macchina-locale-ad-una-remota\/","title":{"rendered":"Come caricare file via SCP da una macchina locale ad una remota"},"content":{"rendered":"\t\t<div data-akihiro-type=\"ama-post\" data-akihiro-id=\"1075\" class=\"akihiro akihiro-1075\" data-akihiro-post-type=\"post\">\n\t\t\t\t<div class=\"akihiro-element akihiro-element-72e7dff e-flex e-con-boxed e-con e-parent\" data-id=\"72e7dff\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"akihiro-element akihiro-element-343739c akihiro-widget akihiro-widget-text-editor\" data-id=\"343739c\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"akihiro-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>In <a href=\"https:\/\/alessandromasciadri.com\/come-scaricare-file-via-scp-da-una-macchina-remota-ad-una-locale\/\">questo precedente articolo<\/a> abbiamo parlato del comando scp e di come scaricare file e cartelle da un server remoto avendo come destinazione la nostra macchina locale.<\/p><p>In questo articolo consideriamo invece lo scenario inverso: dobbiamo caricare su una macchina remota dei file presenti sul nostro computer locale.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"akihiro-element akihiro-element-a856e5e akihiro-widget akihiro-widget-heading\" data-id=\"a856e5e\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"akihiro-widget-container\">\n\t\t\t\t\t<h3 class=\"akihiro-heading-title akihiro-size-default\">Caricare file su un server remoto via SCP<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"akihiro-element akihiro-element-fa52f0c akihiro-widget akihiro-widget-text-editor\" data-id=\"fa52f0c\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"akihiro-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>L&#8217;esempio seguente mostra come inviare un file chiamato esempio.pdf nella directory remota del server. In questo esempio verr\u00e0 copiato il file nella cartella home dell&#8217;utente remoto alessandro. Vediamo qui sotto l&#8217;esempio:<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"akihiro-element akihiro-element-9d78f6f akihiro-widget akihiro-widget-code-highlight\" data-id=\"9d78f6f\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"akihiro-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-okaidia copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-bash \">\n\t\t\t\t<code readonly=\"true\" class=\"language-bash\">\n\t\t\t\t\t<xmp>scp esempio.pdf alessandro@192.168.1.80:<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"akihiro-element akihiro-element-cb4dba6 akihiro-widget akihiro-widget-text-editor\" data-id=\"cb4dba6\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"akihiro-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Se invece avessimo bisogno di specificare un percorso preciso in cui caricara il file, \u00e8 sufficiente specificarlo dopo i due punti come nel seguente esempio:<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"akihiro-element akihiro-element-1a2ea84 akihiro-widget akihiro-widget-code-highlight\" data-id=\"1a2ea84\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"akihiro-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-okaidia copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-bash \">\n\t\t\t\t<code readonly=\"true\" class=\"language-bash\">\n\t\t\t\t\t<xmp>scp esempio.pdf alessandro@192.168.1.80:dir\/<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"akihiro-element akihiro-element-d1f9ade akihiro-widget akihiro-widget-text-editor\" data-id=\"d1f9ade\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"akihiro-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Teniamo sempre presente che il comando scp \u00e8 stato ideato per mantenere la sintassi il pi\u00f9 vicino possibile a quella del comando cp, quindi, la destinazione del file \u00e8 sempre specificata alla fine del comando sia quando il file venga scaricato che quando venga caricato.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"akihiro-element akihiro-element-05c3e15 akihiro-widget akihiro-widget-heading\" data-id=\"05c3e15\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"akihiro-widget-container\">\n\t\t\t\t\t<h3 class=\"akihiro-heading-title akihiro-size-default\">Caricare una directory su un server remoto via SCP<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"akihiro-element akihiro-element-bef833e akihiro-widget akihiro-widget-text-editor\" data-id=\"bef833e\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"akihiro-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Per caricare una intera directory su un server remoto utilizzando il comando scp \u00e8 sufficiente aggiungere il parametro -r al fine di inviare file ricorsivamente.<\/p><p>Nel seguente esempio carichiamo la directory chiamata my-local-folder nella cartella \/tmp del server remoto.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"akihiro-element akihiro-element-9b6bfee akihiro-widget akihiro-widget-code-highlight\" data-id=\"9b6bfee\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"code-highlight.default\">\n\t\t\t\t<div class=\"akihiro-widget-container\">\n\t\t\t\t\t\t\t<div class=\"prismjs-okaidia copy-to-clipboard \">\n\t\t\t<pre data-line=\"\" class=\"highlight-height language-bash \">\n\t\t\t\t<code readonly=\"true\" class=\"language-bash\">\n\t\t\t\t\t<xmp>scp -r my-local-folder alessandro@192.168.1.80:\/tmp<\/xmp>\n\t\t\t\t<\/code>\n\t\t\t<\/pre>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>In questo precedente articolo abbiamo parlato del comando scp e di come scaricare file e cartelle da un server remoto avendo come destinazione la nostra macchina locale. In questo articolo consideriamo invece lo scenario inverso: dobbiamo caricare su una macchina remota dei file presenti sul nostro computer locale. Caricare file su un server remoto via [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-1075","post","type-post","status-publish","format-standard","hentry","category-sistemistica"],"_links":{"self":[{"href":"https:\/\/alessandromasciadri.com\/ama-json\/wp\/v2\/posts\/1075","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alessandromasciadri.com\/ama-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alessandromasciadri.com\/ama-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alessandromasciadri.com\/ama-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/alessandromasciadri.com\/ama-json\/wp\/v2\/comments?post=1075"}],"version-history":[{"count":14,"href":"https:\/\/alessandromasciadri.com\/ama-json\/wp\/v2\/posts\/1075\/revisions"}],"predecessor-version":[{"id":1090,"href":"https:\/\/alessandromasciadri.com\/ama-json\/wp\/v2\/posts\/1075\/revisions\/1090"}],"wp:attachment":[{"href":"https:\/\/alessandromasciadri.com\/ama-json\/wp\/v2\/media?parent=1075"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alessandromasciadri.com\/ama-json\/wp\/v2\/categories?post=1075"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alessandromasciadri.com\/ama-json\/wp\/v2\/tags?post=1075"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}