{"id":263,"date":"2020-11-05T18:24:53","date_gmt":"2020-11-05T18:24:53","guid":{"rendered":"http:\/\/metajack.org\/blog\/?p=263"},"modified":"2020-11-05T18:26:28","modified_gmt":"2020-11-05T18:26:28","slug":"using-a-private-key-file-with-sftp-over-lftp","status":"publish","type":"post","link":"https:\/\/metajack.org\/blog\/2020\/11\/05\/using-a-private-key-file-with-sftp-over-lftp\/","title":{"rendered":"Using a private key file with sftp over lftp"},"content":{"rendered":"\n<p>I ran into a few issues trying to use a non-default private key file with lftp. Here is how I got it to work:<\/p>\n\n\n\n<p>inside ~\/.lftprc put <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>set sftp:connect-program \"ssh -p 23 -a -x -i \/home\/my_user\/.ssh\/key_name_here\"<\/code><\/pre>\n\n\n\n<p>The important items are what is passed to the -i option &#8211; this should be the private key you want to use. In my example I&#8217;m also using a non-standard port (-p 23 for port 23)<\/p>\n\n\n\n<p>To connect, run:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>lftp -u your_user_name,blank sftp:\/\/your-server.org<\/code><\/pre>\n\n\n\n<p>For this to work you need to:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>specify sftp:\/\/ as the server type<\/li><li>set the password to a junk value, I use &#8220;blank&#8221;<\/li><\/ul>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I ran into a few issues trying to use a non-default private key file with lftp. Here is how I got it to work: inside ~\/.lftprc put The important items are what is passed to the -i option &#8211; this should be the private key you want to use. In my example I&#8217;m also using &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/metajack.org\/blog\/2020\/11\/05\/using-a-private-key-file-with-sftp-over-lftp\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Using a private key file with sftp over lftp&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-263","post","type-post","status-publish","format-standard","hentry","category-uncategorized","entry"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/metajack.org\/blog\/wp-json\/wp\/v2\/posts\/263","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/metajack.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/metajack.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/metajack.org\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/metajack.org\/blog\/wp-json\/wp\/v2\/comments?post=263"}],"version-history":[{"count":2,"href":"https:\/\/metajack.org\/blog\/wp-json\/wp\/v2\/posts\/263\/revisions"}],"predecessor-version":[{"id":265,"href":"https:\/\/metajack.org\/blog\/wp-json\/wp\/v2\/posts\/263\/revisions\/265"}],"wp:attachment":[{"href":"https:\/\/metajack.org\/blog\/wp-json\/wp\/v2\/media?parent=263"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/metajack.org\/blog\/wp-json\/wp\/v2\/categories?post=263"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/metajack.org\/blog\/wp-json\/wp\/v2\/tags?post=263"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}