WinSCP is an open source tool for Windows that allows files to be safely copied between local and remote computers (SFTP and FTP). Installing WinSCP is a simple process. It begins with visiting the WinSCP site, clicking the Download link at the top of the page, and doing what comes naturally. Accepting default options during installation should suit most users' needs. Anyone generally familiar with both GUI FTP clients and SSH tools should be able to manage basic functionality of WinSCP using password authentication; the use of the login screen is fairly self-evident.

Using public key authentication with WinSCP is a bit less obvious. In fact, it cannot be done with WinSCP alone: it requires the use of an external tool, such as the PuTTYgen application, to generate a keypair that WinSCP will use to negotiate authentication with the SSH server. "Installing" PuTTYgen is even easier than doing so with WinSCP, however. It consists solely of opening the PuTTY site in a browser, clicking the Download link at the top of the page, and clicking the puttygen.exe link to download the file. Instead of an installer, this download will be the program. When finished downloading, running the program is just a double-click away.

Opening PuTTYgen presents a key generation dialog. It should be set to a default of SSH-2 RSA for the type of key to be generated, using a 1024 bit key. Check with system administrators or policy makers, if applicable, to find out whether there are key type and size requirements before generating a key. When a key type and size has been selected, click the Generate button.

A progress bar will appear at the top of the dialog, with the words, "Please generate some randomness by moving the mouse over the blank area." The space just below the progress bar is the "blank area" indicated, and the progress bar will move as the user moves the mouse cursor in that area enough to contribute some randomness for the key generation process to use.

When that step is finished, a public key will be shown at the top of the dialog, and blank fields for choosing a passphrase for a private key. If the user loses the selected passphrase — which must be entered into both of the passphrase fields so the key generator will have some kind of confirmation that a key was not entered incorrectly — access to the private key will be lost as well, rendering that keypair useless. To fix that problem, this entire process will have to be undertaken again, including the placement of the public key on the target server (described below). A password manager, such as Password Safe, can help out here.

The public key text shown at the top of the key generator dialog is labeled "Public key for pasting into OpenSSH authorized_keys file:", and describes in general what must be done with it. The remote server to which the user needs access should have a ~/.ssh directory within the home directory of the user account that will be used for server login, and if that directory does not yet exist, it may need to be created. Within that directory, there may be an authorized_keys file; if not, it too should be created. The entirety of the public key text provided in the key generator dialog should be copied into that authorized_keys file as a single line (not counting editor linewrap).

Finally, after copying the public key text where it needs to be and entering a private key passphrase (twice), both the Save public key and Save private key buttons should be clicked. The public key can be saved under any filename and in any location at all. Its purpose, as suggested by the term "public key", is to be publicly shared. The private key, however, will come with a special .ppk filename extension, and should be protected from accidental sharing with others. Once someone else has a copy of a private key, the usefulness of the keypair for ensuring the user's privacy has been compromised.

When this is all done, the user can create and save a public key authenticated session configuration in WinSCP. From the WinSCP Login dialog, the user should enter the correct information for the Host name: and User name: fields, and set the correct port number if the default SSH port (number 22) is not used. Instead of using password authentication, however, the user should click the ... button in the Private key file: field to browse the filesystem and select the .ppk file created when the private key was saved. The default protocol selection (SFTP, with the Allow SCP fallback checkbox checked) is most likely appropriate. With that all done, the user should save the session to make it easier to establish a new connection at a later date by clicking the Save... button.

 

After saving the session configuration, WinSCP will open the stored sessions dialog. Double-clicking the saved session's name will open the session, subject to entering the passphrase for the private key. This is the same passphrase as was entered for the private key in PuTTYgen's key generation dialog, which the user may have saved in a password manager. Once the correct passphrase for the private key has been entered, WinSCP should complete the authentication process, and the file management window will open, allowing the user to move files between the local and remote systems across an encrypted connection.

Of course, when contemplating connecting to a secure Unix system using an SSH client on MS Windows, it is probably a good idea to protect yourself from closed source SSH environments

How to use WinSCP with public key authentication的更多相关文章

  1. 使用public key来做SSH authentication

    public key authentication(公钥认证)是对通过敲用户名.密码方式登录服务器的一种替代办法.这种方法更加安全更具有适应性,但是更难以配置. 传统的密码认证方式中,你通过证明你你知 ...

  2. Putty使用公钥认证时,报错:Disconnected: No supported authentication methods available(server sent:public key) 问题的解决

    Putty使用公钥认证时,按照常规方法设置,一直报错:Disconnected: No supported authentication methods available (server sent: ...

  3. Github 访问时出现Permission denied (public key)

    一. 发现问题: 使用 git clone 命令时出现Permission denied (public key) . 二. 解决问题: 1.首先尝试重新添加以前生成的key,添加多次,仍然不起作用. ...

  4. Xshell配置ssh免密码登录-密钥公钥(Public key)与私钥(Private Key)登录【已成功实例】

    本文转自https://blog.csdn.net/qjc_501165091/article/details/51278696 ssh登录提供两种认证方式:口令(密码)认证方式和密钥认证方式.其中口 ...

  5. Putty之public key ssh认证入门

    1.工作平台 客户端:Win2kEn Sp3,Putty Beta 0.53 服务器:RedHat72,OpenSSH_3.4p1 2.Putty简介 一个免费小巧的Win32平台下的ssh客户端.它 ...

  6. Domino----The Address Book does not contain a cross certificate capable of validating the public key.

    The Address Book does not contain a cross certificate capable of validating the public key. 地址本不包含交叉 ...

  7. 在iOS中使用OpenSSL的Public Key 进行加密

    这几天一直潜心于iOS开发,刚好把遇到的问题都记录一下.这次遇到的问题就是如果根据得到的Public Key在iOS 客户端对用户名和密码进行加密. Public Key如下: -----BEGIN ...

  8. windows,linux,mac生成ssh public key 和 private key

    https://help.launchpad.net/YourAccount/CreatingAnSSHKeyPair Creating the key How you create your SSH ...

  9. 公钥(Public Key)与私钥(Private Key)

    公钥(Public Key)与私钥(Private Key)是通过一种算法得到的一个密钥对(即一个公钥和一个私钥),公钥是密钥对中公开的部分,私钥则是非公开的部分.公钥通常用于加密会话密钥.验证数字签 ...

随机推荐

  1. ps的入门

    ps的入门 http://www.cnblogs.com/qingci/archive/2012/09/20/2694728.html

  2. 【2017"百度之星"程序设计大赛 - 初赛(A)】今夕何夕

    [链接]http://bestcoder.hdu.edu.cn/contests/contest_showproblem.php?cid=775&pid=1005 [题意] 在这里写题意 [题 ...

  3. android:一个Open键引发的问题!!

    1.问题简单介绍 首先描写叙述一下问题.当我们安装完APP的时候,界面会显示两个button,一个完毕键,一个Open键,点击Open键之后.进入应用.此时.我们点击HOME键.程序将会后台.然后再点 ...

  4. 关于在IISserver上执行asp.net Web程序出现以下 “Could not load file or assembly。。。”问题的

    Could not load file or assembly 'System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, Public ...

  5. Linux CentOS PhpMyAdmin安装--转载

    原文地址:https://www.centos.bz/2011/04/linux-centos-phpmyadmin-install/ 安装好PHP,Apache和MySQL程序后,为了管理MySQL ...

  6. call.apply.冒充对象继承

    call方法:让调用对象执行,然后第一参数是谁.调用对象的this就改变,指向谁,后边跟参数,依次对应传入 apply方法:让调用对象执行,然后第一参数是谁.调用对象的this就改变指向是谁,后边跟参 ...

  7. python3 pygame 坦克自动移动

    让坦克自动跑起来 这里需要一个坦克的图. 放到与脚本同一目录. 好,我们就让这个坦克自动跑. 下面上代码: # !/usr/bin/env python # -*- coding:utf-8 -*- ...

  8. Day1:字符编码

    一.ASCII码 ASCII(American Standard Code for Information Interchange,美国标准信息交换代码),8位,一个字节,最多只能表示255个符号. ...

  9. struts2笔记---struts2的执行过程

    1.服务器启动: 加载项目web.xml 创建struts核心过滤器对象,执行filter-->init() struts-default.xml     核心功能的初始化 struts-plu ...

  10. Snail—Hibernate之自写固定组件

    Hibernate的存储都是在session中进行的,此session非彼session 以下就是从生成的Hibernate配置文件获得连接数据库,然后再得到session等等 package com ...