zoukankan      html  css  js  c++  java
  • SecureCRT、FileZilla使用Public证书登录Linux

    一、简介

    服务器部署之后一般都配置了防火墙,一般也都开启了ssh,可以直接登录远程服务器,为了安全等原因,在服务器部署之后会使用Public key 登录服务器,本文主要简单的介绍SecureCRT、FileZilla中如何使用ssh Public key 登录服务器,仅仅作为基础的讲解,如有疑问或者建议,请评论,加强的配置可以查考:http://os.51cto.com/art/200803 /68174_all.htm

     

    二、密钥与公钥

    1、使用ssh连接到Server

    2、生成密钥与公钥key(可以默认文件名)

    1 ssh-keygen -t dsa -b 1024

    3、复制内容并设置权限(authorized_keys文件名与ssh的配置有关)

    1 cat ~/.ssh/id_dsa.pub >> /root/.ssh/authorized_keys
    2 chmod 600 ~/.ssh/authorized_keys

    4、将id_dsa、id_dsa.pub与下载到本地,删除Server上的两个文件

     

    三、配置ssh

    1、修改配置文件

    1 vi /etc/ssh/sshd_config
    2 
    3     Protocol 2     //仅允许使用SSH2
    4     PubkeyAuthentication yes     //启用PublicKey认证
    5     AuthorizedKeysFile .ssh/authorized_keys    //PublicKey文件路径
    6     PasswordAuthentication no     //禁止密码验证登录

    2、重启ssh服务

    1  service sshd restart或者service ssh restart

      

    四、SecureCRT中使用public key

    1、创建一个新的Session

    2、输入hostname与username,完成后不要直接打开,选择刚才的session右键properties

    3、选择左侧SSH2,右侧保留PublicKey,配置Properties

    4、直接进入了

     

     

    五 、FileZilla中使用Public key

    1、选择 编辑>设置>SFTP

    2、添加密钥文件,选择生成的密钥文件

    3、提示密钥格式不被支持,选择“是”,然后输入密码另存为一个“ppk”文件(注意:虽然生成了ppk但是一定要再次添加ppk文件)

    4、添加生成的ppk文件到密钥文件

    5、打开站点管理器,选择协议为SFTP,登陆类型为正常,输入用户名,密码为空

    6、可以连接到Server了

     

     

  • 相关阅读:
    ABP文档翻译--值对象
    (转)SqlServer 数据库同步的两种方式 (发布、订阅),主从数据库之间的同步
    Sql Service 的job作业新建过程
    Python --- pyinstaller --- 打包成exe并更换图标
    基于树形检测器的多标志识别
    记录 TypeError: render() got an unexpected keyword argument 'renderer' 错误
    Dockerfile 关键字
    Go new 和 make的区别
    Go的数据类型
    Mac Go 环境变量配置
  • 原文地址:https://www.cnblogs.com/vikde/p/4463304.html
Copyright © 2011-2022 走看看