{"id":1450,"date":"2025-02-24T05:10:50","date_gmt":"2025-02-24T05:10:50","guid":{"rendered":"https:\/\/tiemensfamily.com\/timoncs\/?p=1450"},"modified":"2025-03-18T21:25:51","modified_gmt":"2025-03-18T21:25:51","slug":"ssh-path-canonicalization-failed","status":"publish","type":"post","link":"https:\/\/tiemensfamily.com\/timoncs\/2025\/02\/24\/ssh-path-canonicalization-failed\/","title":{"rendered":"SSH path canonicalization failed"},"content":{"rendered":"\n<p>Yet another &#8220;change stuff just to change stuff&#8221; explanation and fix.<\/p>\n\n\n\n<p>Problem: you see &#8220;No such file&#8221; or &#8220;path canonicalization failed&#8221; after an scp command line that used to work correctly.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tim@timub2404:~\/eclipse-work$ scp -r  socialsecurity.git tim@reposerver:\/home\/tim\/\ntim@reposerver's password: \nscp: realpath \/home\/tim\/socialsecurity.git: No such file\nscp: upload \"\/home\/tim\/socialsecurity.git\": path canonicalization failed\nscp: failed to upload directory socialsecurity.git to \/home\/tim\/\n<\/code><\/pre>\n\n\n\n<p>Fix: add a &#8220;-O&#8221; argument to your &#8220;scp&#8221; command line:<\/p>\n\n\n\n<p>The -O tells scp to use the Original algorithm. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tim@timub2404:~\/eclipse-work$ scp -r -O socialsecurity.git tim@reposerver:\/home\/tim\/\ntim@reposerver's password: \nHEAD                                          100%   21    11.5KB\/s   00:00    \n0b582a00b112f748f21bb23ffa752914571733        100%  824   319.8KB\/s   00:00    \nfc089c9ada51bd2c992218e71b647639bd1120        100%  845   612.1KB\/s   00:00    \n  &lt;&lt;snip unhelpful>> \nconfig                                        100%  136    98.3KB\/s   00:00    \n<\/code><\/pre>\n\n\n\n<p>Do you care why you need &#8220;-O&#8221;?  I know I don&#8217;t.  Ubuntu 24.04 upgraded its version of scp, so now you need it.  The current man page says &#8220;The legacy SCP protocol (selected by the -O flag) requires execution of the remote user&#8217;s shell to perform glob(3) pattern matching. This requires careful quoting of any characters that have special meaning to the remote shell, such as quote characters.&#8221;  <\/p>\n\n\n\n<p>Which, for the above example, is just incorrect.  The command line has no &#8220;~&#8221; or anything else that requires glob() pattern matching.<\/p>\n\n\n\n<p>BTW &#8211; another valid work-around is to put your directory into a single .tgz file, and scp that without the -r command line argument.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Yet another &#8220;change stuff just to change stuff&#8221; explanation and fix. Problem: you see &#8220;No such file&#8221; or &#8220;path canonicalization failed&#8221; after an scp command line that used to work correctly. Fix: add a &#8220;-O&#8221; argument to your &#8220;scp&#8221; command &hellip; <a href=\"https:\/\/tiemensfamily.com\/timoncs\/2025\/02\/24\/ssh-path-canonicalization-failed\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[6,8],"tags":[],"_links":{"self":[{"href":"https:\/\/tiemensfamily.com\/timoncs\/wp-json\/wp\/v2\/posts\/1450"}],"collection":[{"href":"https:\/\/tiemensfamily.com\/timoncs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tiemensfamily.com\/timoncs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tiemensfamily.com\/timoncs\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/tiemensfamily.com\/timoncs\/wp-json\/wp\/v2\/comments?post=1450"}],"version-history":[{"count":2,"href":"https:\/\/tiemensfamily.com\/timoncs\/wp-json\/wp\/v2\/posts\/1450\/revisions"}],"predecessor-version":[{"id":1458,"href":"https:\/\/tiemensfamily.com\/timoncs\/wp-json\/wp\/v2\/posts\/1450\/revisions\/1458"}],"wp:attachment":[{"href":"https:\/\/tiemensfamily.com\/timoncs\/wp-json\/wp\/v2\/media?parent=1450"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tiemensfamily.com\/timoncs\/wp-json\/wp\/v2\/categories?post=1450"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tiemensfamily.com\/timoncs\/wp-json\/wp\/v2\/tags?post=1450"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}