- What Is Public Key
- Generate Public Key In Cyberduck Key
- Public Key Example
- Generate Public Key In Cyberduck Free
Opened on Sep 19, 2007 at 2:59:00 PM
Closed on Mar 27, 2010 at 5:34:15 PM
Try to create a key using the ssh-keygen program from the OpenSSH distribution. The one you are using is not a supported format. The one you are using is not a supported format. Comment:15 in reply to: ↑ 14 Changed on May 15, 2009 at 12:11:51 PM by dkocher. To create a new key pair, select the type of key to generate from the bottom of the screen (using SSH-2 RSA with 2048 bit key size is good for most people; another good well-known alternative is ECDSA). Then click Generate, and start moving the mouse within the Window. Putty uses mouse movements to collect randomness.
Step 2: Generate a new SSH key pair. You can use the ssh-keygen command to generate a new SSH key pair as follows: ssh-keygen -t rsa -b 4096. This command will take a while to run, since it's using 4096 bits in the key (as specified by the -b 4096 option). After a short while the computer will output the following.
Last modified on May 15, 2011 at 4:51:03 PM
#1264closeddefect (fixed)
Reported by: | Owned by: | dkocher | |
---|---|---|---|
Priority: | high | Milestone: | 3.4.2 |
Component: | sftp | Version: | 2.7.3 |
Severity: | blocker | Keywords: | |
Cc: | Architecture: | ||
Platform: |
Attachments (1)
- cyberduck_error.png (33.4 KB) - added by dkocheron Dec 19, 2007 at 11:23:06 PM.
Download all attachments as: .zip
Change History (25)
comment:1 Changed on Sep 19, 2007 at 8:14:18 PM by dkocher
comment:2 Changed on Nov 19, 2007 at 1:10:12 PM by fisler
- Ccjoel.fisler@id.uzh.ch added
comment:3 Changed on Dec 4, 2007 at 9:05:15 PM by dkocher
- Milestone set to 2.8.3
- Resolution set to worksforme
- Status changed from new to closed
What Is Public Key
comment:4 Changed on Dec 10, 2007 at 7:22:37 PM by fisler
- Resolutionworksforme deleted
- Status changed from closed to reopened
Changed on Dec 19, 2007 at 11:23:06 PM by dkocher
- Attachmentcyberduck_error.png added
comment:5 Changed on Dec 19, 2007 at 11:26:22 PM by dkocher
comment:6 Changed on Dec 19, 2007 at 11:27:44 PM by dkocher
comment:7 Changed on Dec 23, 2007 at 8:11:56 PM by dkocher
- Resolution set to worksforme
- Status changed from reopened to closed
comment:8 Changed on Jan 7, 2008 at 4:09:52 PM by fisler
- Resolutionworksforme deleted
- Status changed from closed to reopened
comment:9 Changed on Jan 7, 2008 at 4:17:40 PM by fisler
comment:10 Changed on Jan 21, 2008 at 4:22:41 PM by dkocher
comment:11 Changed on Jan 23, 2008 at 6:59:10 PM by dkocher
- Milestone2.8.4 deleted
comment:12 Changed on May 15, 2009 at 11:15:52 AM by DukBerCy
comment:13follow-up:↓ 14 Changed on May 15, 2009 at 11:22:00 AM by DukBerCy
comment:14 in reply to: ↑ 13 ; follow-up:↓ 15 Changed on May 15, 2009 at 12:11:04 PM by dkocher
comment:15 in reply to: ↑ 14 Changed on May 15, 2009 at 12:11:51 PM by dkocher
comment:16 Changed on Jul 19, 2009 at 3:48:55 PM by anonymous
comment:17follow-up:↓ 18 Changed on Nov 15, 2009 at 10:08:41 PM by sidd
comment:18 in reply to: ↑ 17 ; follow-up:↓ 19 Changed on Nov 15, 2009 at 11:21:33 PM by sidd
comment:19 in reply to: ↑ 18 Changed on Nov 15, 2009 at 11:40:28 PM by dkocher
Generate Public Key In Cyberduck Key
comment:20follow-up:↓ 21 Changed on Feb 17, 2010 at 3:53:56 PM by Babypoohbearnme@yahoo.com
comment:21 in reply to: ↑ 20 Changed on Mar 5, 2010 at 1:39:43 PM by gerbsen@gmail.com
comment:22follow-up:↓ 23 Changed on Mar 10, 2010 at 4:11:40 PM by tismer@stackless.com
comment:23 in reply to: ↑ 22 Changed on Mar 27, 2010 at 5:34:15 PM by dkocher
- Milestone set to 3.4.2
- Resolution set to fixed
- Status changed from reopened to closed
comment:24 Changed on May 15, 2011 at 4:51:03 PM by peterhil
Download in other formats:
To get SSH or SFTP access to a server without using a password you need to have a SSH key pair for each computer you want to be able to access the server from. In this document I’ll describe the steps you need to take to generate a key pair if you don’t have one already. If you do, you can use your public key(s) to get access to the server.
I'll also explain how to connect to your server using Cyberduck. Click here to skip to that part.
Disclaimer and stuff
This guide is written with newbies in mind, so I'm very thorough in describing the steps that you must take.This guide will not cover setting up the server side of this system. It assumes that there's a server running with SSH enabled.Be very careful while following this guide. You could screw things up quite badly if you do something wrong. I am not responsible for any damages to your system.
Generating your SSH key pair
Generating your SSH key pair is different for *nix and Windows computers. If you're on a *nix computer follow these steps and if you're on a Windows computer follow these steps.
*nix (Unix / Linux / Apple OS X / etc.)
To generate a key pair on *nix systems you need to open up your Terminal application (command line). Within Terminal you can enter commands and execute them by pressing the enter
key. In OS X you can find Terminal under Applications -> Utilities -> Terminal.
Step 1: Check for existing SSH keys
The first step is to check if you already have SSH keys on your computer. If so, you can use those for authentication and you shouldn’t overwrite them with new ones. If you do overwrite the existing SSH keys, you may not be able to access previously used servers anymore!
Enter the following command:
If the computer returns something like below you don’t have any existing SSH keys and can continue with step 2:
If the computer returns something like below you do have existing SSH keys and can skip to step 3:
Step 2: Generate a new SSH key pair
You can use the ssh-keygen command to generate a new SSH key pair as follows:
This command will take a while to run, since it's using 4096 bits in the key (as specified by the -b 4096
option). After a short while the computer will output the following:
Experienced users can enter an absolute path to the file they'd like to use as their private key, but we're going to press enter
to choose the suggested file.
Now the computer will ask for a passphrase (a.k.a. password) for the key file. Enter a personal and strong password you can remember, preferably not your computer password. When you're typing nothing will change on the screen, but that's normal. When you're done typing you can press the enter
key and it'll ask you to enter the same password again, do so and press enter
again:
If you made a mistake here you'll have to enter the password twice again.
The computer will now protect your key with your password and afterwards it'll show something like this (probably without the bunny though):
Step 3: Copy your SSH key
To be able to authencticate you, the server needs to have your public key. Your sysadmin (the guy/gal who has control over the server) needs to have that key. This is quite easily done with the cat
command:
Your computer will output your public SSH key and it'll look something like this:
Use your mouse to select this bunch of characters from ssh-rsa
to user@hostname.local
(yours will probably say something different). Now copy by using CTRL+C (or CMD+C if you're on a Mac) or by right clicking and choosing Copy
.
Now you have the public key copied you can move on to Sending your public key to your sysadmin.
Windows
To generate an SSH key pair on Windows you need to have the PuTTYgen program. You can download that program here (download the puttygen.exe
file).
Step 1: Create a folder for your SSH key pair
The first step is to create a folder on your computer for the SSH key pair. The best location is probably your My Documents
folder. Use Windows Explorer (the program you use to find your files) to go to your documents folder. Now click on File
on the top of the window and select New
and then Folder
. Name this folder ssh
.
Step 2: Generate your SSH key pair with PuTTYgen
Follow these steps to generate an SSH key pair with PuTTYgen:
- Open PuTTYgen by double clicking on the
puttygen.exe
file; - At the bottom of the window you'll see a Parameters section, do the following:
- For Type of key to generate select SSH-2 RSA;
- At Number of bits in a generated key enter 4096;
- Click the Generate button;
- Move your mouse pointer over the area below the progress bar and keep moving it around untill the progress bar is full. PuTTYgen will now generate a new SSH key;
- Type a personal and strong password in the Key passphrase field and type the same password in the Confirm passphrase field;
- Click the Save public key button and save the key in the folder you created at step 1 with the following file name:
id_rsa.pub
; - Click the Save private key button and save the key in the same folder as the public key, but name this one
id_rsa.ppk
; - Right click on the Public key for pasting into OpenSSH authorized_keys file text field and choose Select All;
- Right click on the same field again and choose Copy.
Now you have the public key copied you can move on to Sending your public key to your sysadmin.
Step 3: Copy your SSH key (if you haven't already)
If you haven't copied your public SSH key in step 2, you have to open the file with Notepad and copy the contents from there:
- Start by opening Notepad: Click Start, Programs, Accessories and Notepad;
- Now in Notepad click on
File
andOpen
. Open theid_rsa.pub
file in yourssh
folder; - Select all text by right clicking and choosing
Select All
; - Right click again and choose
Copy
.
Now you can go to the last step: Sending your public key to your sysadmin.
Sending your public key to your sysadmin
With your public SSH key copied you can paste this into an email to your sysadmin and he or she will be able to do the rest. If you haven't copied your public SSH key yet you can find out how for *nix (Unix / Linux / Apple OS X / etc.) here and for Windows here.
If your sysadmin doesn't know what to do with the public key, or you're the sysadmin and you don't know what to do with the public key (I won't tell, I promise), this is what he / she / you need to do: append the public key to the /home/user/.ssh/authorized_keys
file without newlines or spaces (apart from the spaces after ssh-rsa
and before user@hostname.local
). If the user doesn't exist on the server yet, you'll first need to add him / her / yourself.
Using Cyberduck to access your server
Cyberduck is a free (S)FTP program for Mac and Windows (sorry Linux users!). The main advantage of Cyberduck is that it allows you to select which SSH key you'd like to use to connect to a server. You can follow the steps below to find out how to connect to a SFTP server using Cyberduck.
Download, install and start up Cyberduck
Download Cyberduck here and install it on your computer. After the installation is done open the program.
Setup the connection
To setup the connection to your SFTP server follow the steps below:
Public Key Example
- Click Open Connection:![Open connection image](http://blog.wioo.nl/content/images/2016/02/cd-1.png)
- In the window that opens choose SFTP (SSH File Transfer Protocol) at the top;![Select SFTP](http://blog.wioo.nl/content/images/2016/02/cd-2.png)
- Fill in the following information:
- In the Server field enter the server address (IP address or hostname);
- In the Port field enter the server SSH port if it's not 22;
- In the Username field enter your username for that server;
- Leave the password field empty;![Fill in the information](http://blog.wioo.nl/content/images/2016/02/cd-3.png)
- Click on More Options to open up that part of the window;![Open more options](http://blog.wioo.nl/content/images/2016/02/cd-4.png)
- Check the Use Public Key Authentication checkbox;![Check the checkbox](http://blog.wioo.nl/content/images/2016/02/cd-5.png)
- Select your private key file (
id_rsa
in *nix andid_rsa.ppk
in Windows);![Select your private key file](http://blog.wioo.nl/content/images/2016/02/cd-6.png) - Click the Connect button;![Click connect](http://blog.wioo.nl/content/images/2016/02/cd-7.png)
- You might get a dialog to verify the host, click the Allow button;
- You're now asked to fill in your Private Key Passphrase, fill in the password you've chosen for your SSH key and click the Login button.![Enter your password](http://blog.wioo.nl/content/images/2016/02/cd-8.png)
Generate Public Key In Cyberduck Free
If everything went well you can now browse the files on your server!