Using SSH keys for SFTP Publishing

Hello,

I have created SSH keys for my site host, stored in Keychain, with the ssh config file updated to specify that Keychain should be used for my host. I have verified that ssh-agent is running to provide the key passphrase. From the command line, I can enter the HostName provided in the SSH config file to log in automatically with no password or passphrase prompt (sftp {HostName}). In Blocs 6.1.4, do I still have to specify my site admin password in the Publishing setup, or can I simply use my configured ssh keys?

I should also point out that using my login and password for my web host also does not work with Blocs, because it requires 2FA.

Thanks!
David

Update: I’ve found a workaround for now. I export my project to a local directory tree, then use rsync inside a script to deploy the directory tree to my web host securely using ssh public key authentication. It would be nice if Blocs could use public key authentication directly, but this workaround will do for now.

Thanks
David

1 Like

Frankly, I was waiting for others to chime in here @davidc336 but considering no one else has, I guess I’ll reply.

Blocs doesn’t support SSH keys for publishing and myself and others have requested that this get added numerous times (especially as this is very much the norm in prosumer/professional circles).

Glad you found a work around and at least for myself (and others out there too), I’m using ForkLift by Binary Nights. A bit of a hassle for publishing as it’s multi-step/app but it works.

But mind you, even if Norm adds in SSH keys for authentication, that only solves half of the equation for me as Blocs also doesn’t support adding text/html files to your exported assets so I’d still need to use ForkLift as I have files in my root such as robots.txt, and a couple of website verification files such as a .txt and .html (can’t recall if it was Google, Bing or some other website/DNS validation that required these files) that I’d still need to manually add to my export/publishing on my website.

@PatrickSalo, thanks for confirming that SSH keys don’t work with Blocs. It’s also interesting what you say about exported assets. I had not even thought of that. I guess when the time comes, I’ll be glad that I have my rsync scripted. I can always add logic to my script to also copy the asset files.

Other than this hiccup, I’ve really been enjoying Blocs. I’m new to this program and web development in general (I’m an embedded C++ programmer), and have found Blocs to be really approachable and logical. Though I haven’t gotten down in the weeds much yet.

Cheers

1 Like

Well welcome aboard and you and I are cut from similar cloth, as I’m a dev too. I agree, once you get used to Blocs workflows, it can be quite the time saver and can do some really cool things.