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  
  • 相关阅读:
    Redis Sentinel 哨兵模式
    Redis 读写分离
    Redis 分布式锁实现
    Redis 缓存的收益和成本
    Redis 实现排行榜
    Spring Boot 使用 Cache 缓存
    Spring Boot 整合 Redis
    Spring Boot 使用阿里巴巴 Druid 数据源
    Spring Boot 整合 JWT
    B1003
  • 原文地址:https://www.cnblogs.com/mrma/p/12845085.html
Copyright © 2011-2022 走看看