Semblance Digital Studio

Design and digital studio for startups, using WordPress as a CMS

  • Home
  • Services
  • Projects
  • Blog
  • Contact
You are here: Home / Blog / Online and Technical / How to connect to a SFTP server from a Mac using a Private Key

How to connect to a SFTP server from a Mac using a Private Key

Posted on 22 June 2012 in Online and Technical ♦ Estimate reading time: 3 minutes ♦ by Elzette Roelofse

Connecting with Private Key

This blog post is how to connect to a server via the SFTP protocol, thus connecting to a server securely with SSH keys. The client create a SSH Public and Private Key. The Private Key gets sent to me. I use Cyberduck, which is free for Mac, to connect via SFTP Protocol.

Before you can connect with Cyberduck to the SFTP sever, you need to copy the Private Key in your Mac’s .ssh directory. This is a hidden directory. If it doesn’t exist then you need to create one. Lets first check if it exist via Terminal. Open terminal from Applications > Utilities > Terminal.

.ssh directory

  1. With a Terminal session open, make sure you are in your User/$Home directory.
  2. Type the following command to get a full directory listing.
    ls -a
  3. Make sure the hidden directory .ssh exists. If it doesn’t you will need to create it with the mkdir .ssh command.

* You can also try TinkerTool, a nifty tool to let you see hidden directory in Finder.

Copy Private Key to .ssh directory

Go to folder on Mac

  1. Go to Finder by clicking anywhere on the Desktop
  2. On the menu, select Go to Folder and type ~/.ssh. This will open the window of the hidden .ssh directory.
  3. Copy the Private Key – id_rsa in the directory.

Configure Private Key with host from Terminal

  1. From the Terminal session, run the following command: ssh username@local-ip-address
  2. The run the following command to get the right permission set to the Private Key
    cd ~/.ssh
    chmod 600 id_rsa
    chmod 500 .

Connecting to the Server using the Key

Cyberduck Screen Shot

  1. Open Cyberduck and click on Open Connection
  2. Select SFTP protocol from the drop down list
  3. Fill in the rest of the details to connect

There is a possibility that the host also need to set up a few settings on their side. For example, use your computer’s IP to give a specific computer permission to connect.

Related Posts

  • WordCamp Europe 2015WordCamp Europe 2015
  • Translating WordPress – af_ZATranslating WordPress – af_ZA
  • Choose Your Colour (Part 2): Litho vs. Digital PrintingChoose Your Colour (Part 2): Litho vs. Digital Printing

No Comments

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

semblance logo enquiries@semblance.design © 2022
  • Email
  • Twitter
  • Instagram