{"id":1643,"date":"2015-01-23T00:01:43","date_gmt":"2015-01-23T00:01:43","guid":{"rendered":"https:\/\/qbytes.cloud\/?p=1643"},"modified":"2015-01-23T00:01:43","modified_gmt":"2015-01-23T00:01:43","slug":"scp-examples","status":"publish","type":"post","link":"https:\/\/www.qbytes.cloud\/index.php\/2015\/01\/23\/scp-examples\/","title":{"rendered":"SCP Examples"},"content":{"rendered":"<p>How to secure copy a file from remote server to to local directory:<br \/>\n\/home\/user\/file.txt = remote file<br \/>\n\/home\/user\/Desktop\/ = path to copy to local system<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\n# scp -r user@remote.server.com:\/home\/user\/file.txt \/home\/user\/Desktop\/\n<\/pre>\n<p>-r Recursively copy entire directories<\/p>\n<p>What if the port is on 2243?<\/p>\n<p>Use:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# scp -P2243 -r user@remote.server.com:\/home\/user\/file.txt \/home\/user\/Desktop\/\n<\/pre>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n\n# scp -P -r user@remote.server.com:\/home\/user\/file.txt \/home\/user\/Desktop\/\n\n<\/pre>\n<p>-P port   Specifies the port to connect to on the remote host. Note that this option is written with a capital &#8216;P&#8217;, because -p is already reserved for preserving the times and modes of the file in rcp(1).<\/p>\n<p>-p           Preserves modification times, access times, and modes from the original file.<\/p>\n<p>Copy from local to remote:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n# scp -P 22 file.txt root@192.168.1.1:\/vmfs\/volumes\/datastore1\/ISO\n<\/pre>\n<p>SCP with key<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n$ scp -i \/home\/admin\/ipfs.pem FILE user@server:\/home\/admin\/\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>How to secure copy a file from remote server to to local directory: \/home\/user\/file.txt = remote file \/home\/user\/Desktop\/ = path to copy to local system # scp -r user@remote.server.com:\/home\/user\/file.txt \/home\/user\/Desktop\/ -r Recursively copy entire directories What if the port is on 2243? Use: # scp -P2243 -r user@remote.server.com:\/home\/user\/file.txt \/home\/user\/Desktop\/ # scp -P -r user@remote.server.com:\/home\/user\/file.txt \/home\/user\/Desktop\/ &#8230; <a title=\"SCP Examples\" class=\"read-more\" href=\"https:\/\/www.qbytes.cloud\/index.php\/2015\/01\/23\/scp-examples\/\" aria-label=\"Read more about SCP Examples\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[56],"tags":[],"class_list":["post-1643","post","type-post","status-publish","format-standard","hentry","category-kb"],"_links":{"self":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/1643","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/comments?post=1643"}],"version-history":[{"count":0,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/1643\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/media?parent=1643"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/categories?post=1643"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/tags?post=1643"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}