zoukankan      html  css  js  c++  java
  • Linux ssh 免密

    生成rsa

    ssh-keygen -t rsa 

    将生成的秘钥发送到其他服务器

    ssh-copy-id hadoop1

    执行结果

    [root@hadoop2 ~]# ssh-copy-id hadoop1
    /usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
    The authenticity of host 'hadoop1 (192.168.52.101)' can't be established.
    ECDSA key fingerprint is SHA256:tmlEUTX/zC4HLJENTTO6X2Kx0ELMHn95iT9c8foctvI.
    ECDSA key fingerprint is MD5:1a:04:b6:95:d7:2e:ec:a0:50:04:46:9d:2a:73:77:0e.
    Are you sure you want to continue connecting (yes/no)? yes
    /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
    /usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
    root@hadoop1's password: 
    
    Number of key(s) added: 1
    
    Now try logging into the machine, with:   "ssh 'hadoop1'"
    and check to make sure that only the key(s) you wanted were added.

    将authorized_keys发送到其他服务器的方法:

    定位到authorized_keys 存放位置

    cd /root/.ssh

    scp authorized_keys hadoop1:$PWD

    执行结果:

    [root@hadoop1 ~]# cd /root/.ssh
    [root@hadoop1 .ssh]# scp authorized_keys hadoop1:$PWD
    root@hadoop1's password: 
    authorized_keys  
  • 相关阅读:
    seajs加载angularjs
    seajs加载jquery提示$ is not a function
    java 动态代理
    C#第三章--对象和类
    Android笔记--两种双击退出程序的方法
    Android--Volley基本用法及自定义
    Win10专业版只要12.99元?应用商店Bug福利也算数
    新人报道
    排序

  • 原文地址:https://www.cnblogs.com/mrma/p/12845085.html
Copyright © 2011-2022 走看看