How to Connect to Easy PHP Hosting over SSH in a Mac/Linux Terminal
For configuring some types of apps in our Easy PHP hosting, it is convenient to use an SSH connection to execute commands on the server. This guide walks through connecting to Porkbun's Easy PHP hosting using SSH from a Mac or Linux terminal.
Note: SSH connections to Easy PHP hosting do not provide root access. To enable SSH access, your account email address and phone number must both be verified.
- 1
- Log in. You should arrive at the Domain Management screen. If you're already logged in, click the ACCOUNT button in the top-right corner and select Domain Management.
- 2
- From the Domain Management page, click the Easy PHP column for the domain you want to use from the Website column.
- 3
-
From the Easy PHP page for your domain, scroll down the SSH/SFTP section and click the 'request SSH access' button.
After a few moments of processing, you should see 'SSH Access: enabled' appear' in the SSH/SFTP section.
- 4
-
From the same SSH/SFTP section, click the 'generate keys' button.
Then click the 'OK' button in the dialog window that opens.
Once the key is generated, which usually takes just a few seconds, click the 'Download Private Key' button and note where the file gets saved.
After the file has been downloaded, clock the 'Close' button.
- 5
-
Open a terminal window. Once that is open, the first thing we'll need to do is set the correct permissions for the .pem file using the following command, replacing 'PathToFile' with the path to the directory your .pem file is saved in, 'Downloads' by default, and replacing 'publickey.pem' with the filename of your .pem file.
chmod 400 PathToFile/publickey.pem
- 6
-
With those permissions set, we can now connect to the server using the following command
ssh -i PathToFile/publickey.pem domainname@sftp.domainname -p 9022
As with the previous steps, replace 'PathToFile' with the path to the directory your .pem file is located in and 'publickey.pem' with your .pem filename. You'll also replace each instance of 'domainname' with your full domain name. e.g. goosehollow.design. A full example of this for goosehollow.design looks like:
ssh -i Downloads/54267.db5e3a933dcdcb3c8ef3ca6f2f29874c7dcb5e6f3d5f1de7a4ab21a71dac4417.keys-goosehollow.design.pem goosehollow.design@sftp.goosehollow.design -p 9022
The first time you connect, you will need to approve the fingerprint for the connection by typing in 'yes' when prompted.
That's it! You should now be connected and see your domain name in the terminal prompt along with your IP address.