zoukankan      html  css  js  c++  java
  • ECS Linux 服务器公钥秘钥SSH登录

    Ubuntu 14.04.1为例,设置步骤如下:

    一. 生成密钥的公钥和私钥

    1. # ssh-keygen -t rsa 

    2. Generating public/private rsa key pair.

      Enter file in which to save the key (/root/.ssh/id_rsa): 

      Created directory '/root/.ssh'.

      Enter passphrase (empty for no passphrase): #输入密码

      Enter same passphrase again:                #输入密码

      Your identification has been saved in /root/.ssh/id_rsa.

      Your public key has been saved in /root/.ssh/id_rsa.pub.

      The key fingerprint is:

                    1c:37:a8:a3:65:a2:4a:89:ab:46:30:ad:54:d1:40:eb root@iZ28vo50eu5Z

    二. 将生成的私钥(id_rsa)下载到本地的windows机器上,并把公钥导入到.ssh/authorized_keys 文件中去

    #  cd /root/.ssh/

    1. #cat id_rsa.pub > authorized_keys 

    三. 设置sshd  服务器服务,打开以下设置:

    1. RSAAuthentication yes 

    2. PubkeyAuthentication yes

    1. AuthorizedKeysFile      /root/.ssh/authorized_keys 

    2.  修改以下设置: 

    3. ChallengeResponseAuthentication no 

    4. PasswordAuthentication no 

    5. UsePAM no 

    四. 重启ssh服务

    1. #service ssh  restart 

    五. 导入私钥到远程工具中,比如xshell。

         新建连接,点击左边用户身份验证:

     http://help.aliyun.com/knowledge_detail/6502152.html?spm=5176.7114037.1996646101.29.mSdCu4&pos=15

  • 相关阅读:
    utf8编码和中文不能解码问题解决
    python环境的安装配置
    repo同一个仓的同一个changeId的提交
    Jenkins pipeline之将命令的运行结果赋值给变量
    repo和git常用的命令和场景
    docker 安装rabbitmq
    docker的一些概念
    mysql数据库sql优化原则
    数据库优化02
    MySQL数据库优化总结
  • 原文地址:https://www.cnblogs.com/dunitian/p/4970813.html
Copyright © 2011-2022 走看看