zoukankan      html  css  js  c++  java
  • Xshell配置公钥,免密码登陆

    下面讲解如何通过xshell配置使用PubKey 来登录服务器,可以减少通过password登录的麻烦。

    1.先到用户的家目录, cd ~ 

    2.执行ssh-keygen -t dsa(or rsa)

    生成私钥和公钥,然后,将公钥拷贝一份存储为 authorized_keys文件

    cat id_rsa.pub >> authorized_keys

    3.再通过sz命令将公钥下载到本地,

    通过xshell中import 导入功能将公钥添加到xshell软件中

    然后在服务器属性里,选择登录的方法为Public Key

    选择使用的公钥即可使用公钥来登录服务器。

    在配置文件中还要开启允许通过公钥登录的功能。

    [root@linux-node ~]# grep '^[A,P]' /etc/ssh/sshd_config
    PubkeyAuthentication yes #启用PublicKey认证
    AuthorizedKeysFile .ssh/authorized_keys #PublicKey文件路径
    PasswordAuthentication no #不适用密码认证登录

    [root@linux-node ~]# systemctl restart sshd

    配置服务端ssh配置文件, 并重启服务、

  • 相关阅读:
    数据的追踪审计
    通知模块设计
    数据库'tempdb' 的事务日志已满处理方法
    三级联动
    组合查询
    用户控件
    MDI容器
    控件说明
    winfrom
    自动生成编号
  • 原文地址:https://www.cnblogs.com/Enzoo/p/10932288.html
Copyright © 2011-2022 走看看