Using SFTP on your VPS/Enterprise Server
Last Updated -
In order to connect to your VPS server via SFTP you will need to make sure you have entered your public ssh key in the Atomic control panel and that your FTP client supports key-based authentication.
PLEASE NOTE: You will need the private key associated with the public key, which should be attached to your user through the atomic dashboard. If you have not done so, please view the instructions found here.
Locating your ssh private key.
Open terminal and type the following command
$ cd ~/.ssh
Look for id_rsa or id_dsa
If one of those files exist, use the following command to copy the contents to your clipboard
$ pbcopy ~/.ssh/id_rsa
This copies the contents to your clipboard
After you have entered your key please take note of your sftp username as seen below.
If you do not have an existing SSH key follow the instructions below
Creating a new key pair
Open up terminal and use the following commands
$ ssh-keygen -t rsa -C "firstname.lastname@example.org" # Creates a new ssh key, using the provided email as a label # Generating public/private rsa key pair. # Enter file in which to save the key (/Users/you/.ssh/id_rsa): [Press enter]
$ Enter passphrase (empty for no passphrase): [Type a passphrase] # Enter same passphrase again: [Type passphrase again]
You should now see something such as:
Your identification has been saved in /Users/you/.ssh/id_rsa. # Your public key has been saved in /Users/you/.ssh/id_rsa.pub. # The key fingerprint is: # 01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db email@example.com
PLEASE NOTE: You will need the private key associated with the public key, which should be attached to your user through the atomic dashboard. If you have not done so, please view the instructions here.
You are now ready to copy the key to clipboard.
$ pbcopy ~/.ssh/id_rsa
2.Using your ssh key with an SFTP client
2a. Open your favorite FTP client (I will be using Transmit in the following example)
IMPORTANT: Transmit cannot use password encrypted private keys by default. You will need to use a workaround.
- Make sure that "SFTP" protocol is selected.
- Enter your username that we provided.
- Next to the password field click on the "Key" icon, find your pub key located in ~/.ssh Choose Key File (see the second image below)
- Enter port 22.
Normally you'd find your private key in the following directory - open finder > hold control + click on the top middle name of the current directory within finder > select your current OSX user > select the .ssh directory > select the private key as shown below.
You are now ready to connect via SFTP. Click Connect
2b. Another popular SFTP client we recommend is Filezilla. Let's review how to add a SSH key and connect using this program.
Open up Filezilla and select Settings from the menu bar. On Mac, settings is found on the top menu bar via Filezilla --> Settings. On PC, click Edit --> Settings. Then, select SFTP and here you can add your SSH Key. Be sure you select your private key and not the public key. Once the key is selected click OK to save the information.
Now that you have your private SSH key added to Filezilla, you can use Quickconnect to login to the server. Enter in the Host, Username, and Port. The Port will be 22.
When you connect to the VPS for the first time, you will be prompted with a warning about the authenticity of the host. This warning is normal and you can select "yes". Once connected, you will see the list of folders/files on the server.