{"id":1454,"date":"2012-11-01T06:04:46","date_gmt":"2012-11-01T04:04:46","guid":{"rendered":"http:\/\/raftaman.net\/?p=1454"},"modified":"2021-05-15T11:46:38","modified_gmt":"2021-05-15T09:46:38","slug":"rsync-over-ssh-on-non-default-port","status":"publish","type":"post","link":"https:\/\/possiblelossofprecision.net\/?p=1454","title":{"rendered":"rsync over ssh on non-default port"},"content":{"rendered":"<p>There are basically two ways of archiving this<\/p>\n<h2>Changing rsync&#8217;s rsh parameter<\/h2>\n<p>You can simply feed <code>ssh<\/code> with a different port parameter as remote shell to ssh:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n$ rsync -a --inplace --rsh='ssh -p12345' file user@remotehost:dir\/\r\n<\/pre>\n<h2>Create a per host config for ssh<\/h2>\n<p>Add a <code>Host<\/code> entry to <strong><code>~\/.ssh\/config<\/code><\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n&#x5B;...]\r\nHost foobar\r\n    Port 12345\r\n    User user\r\n    Hostname host.example\r\n<\/pre>\n<p>and invoke <code>rsync<\/code> with that alias<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n$ rsync -a --inplace file foobar:dir\/\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>There are basically two ways of archiving this Changing rsync&#8217;s rsh parameter You can simply feed ssh with a different port parameter as remote shell to ssh: $ rsync -a &#8211;inplace &#8211;rsh=&#8217;ssh -p12345&#8242; file user@remotehost:dir\/ Create a per host config for ssh Add a Host entry to ~\/.ssh\/config &#x5B;&#8230;] Host foobar Port 12345 User user Hostname host.example and invoke rsync&#8230; <a href=\"https:\/\/possiblelossofprecision.net\/?p=1454\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[15],"class_list":["post-1454","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-ssh"],"_links":{"self":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts\/1454","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1454"}],"version-history":[{"count":7,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts\/1454\/revisions"}],"predecessor-version":[{"id":2662,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts\/1454\/revisions\/2662"}],"wp:attachment":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1454"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1454"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1454"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}