This post covers how to set up SSH and SFTP access with Ploi. While you don't need either of these things set up to deploy a site with Statamic, they can still be handy for troubleshooting and understanding what's going on.
Adding Your Computer’s SSH Key to Ploi
You'll first need to add your computer's SSH key to Ploi. You'll also need to do this if you connect via SFTP using software that uses your computer's SSH key (Forklift is an example of this).
Copy your computer's SSH key. You can do this by running
cat ~/.ssh/id_rsa.pubif you have a key with RSA encryption, or
cat ~/.ssh/id_ed25519.pubif you have a key with ED encryption
Open Terminal and SSH into your server by running
ssh ploi@youripaddresshere, which will look something like
ssh firstname.lastname@example.org. You should now be logged into your server.
Making Your SSH Key Persistent
If you're running macOS 10.12 or later (you probably are) then you'll need to do a few things to make your SSH key persistent. Create a
config file in your SSH directory (the same directory where your public key is, e.g., .ssh/) and in the config file add the text:
Host * AddKeysToAgent yes UseKeychain yes IdentityFile ~/.ssh/id_ed25519
If you're running with the older RSA encryption then it will look like this:
Host * AddKeysToAgent yes UseKeychain yes IdentityFile ~/.ssh/id_rsa
Finally, run the following in Terminal:
ssh-add -K ~/.ssh/id_ed25519
Or if you're running with the older RSA encryption:
ssh-add -K ~/.ssh/id_rsa
This is a sample of what your SFTP details will look like:
Protocol: SFTP Server: 184.108.40.206 (replace this with your server's ip address) Username: ploi Password: this will be the 'sudo' password you were sent when Ploi installed your server Port: 22