• ssh -i 密钥文件无法登陆问题


    一、用ssh 带密钥文件登录时候,发生以下报错
     [root@99cloud1 ~]# ssh -i hz-keypair-demo.pem centos@172.16.17.104
    The authenticity of host '172.16.17.104 (172.16.17.104)' can't be established.
    ECDSA key fingerprint is SHA256:HXYEa2IVBhTJ1AO+GDvROEvHM5ZRLgKxXsSaFmc6CNc.
    ECDSA key fingerprint is MD5:cd:dd:3f:dd:66:91:30:4c:0e:e5:a2:35:45:c2:23:41.
    Are you sure you want to continue connecting (yes/no)? yes
    Warning: Permanently added '172.16.17.104' (ECDSA) to the list of known hosts.
    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    @         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    Permissions 0777 for 'hz-keypair-demo.pem' are too open.
    It is required that your private key files are NOT accessible by others.
    This private key will be ignored.
    Load key "hz-keypair-demo.pem": bad permissions
    Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
    二、修改密钥文件权限

    [root@99cloud1 ~]# chmod 600 hz-keypair-demo.pem
    [root@99cloud1 ~]# ip netns exec qdhcp-c2bc63d3-6ab2-4862-96f0-1a6d91df92f8 ssh -i hz-keypair-demo.pem centos@172.16.17.104

    三、正常登录

    [root@99cloud1 ~]# ssh -i hz-keypair-demo.pem centos@172.16.17.104
    [centos@centos0130 ~]$ ip add
    1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
        link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
        inet 127.0.0.1/8 scope host lo
           valid_lft forever preferred_lft forever
        inet6 ::1/128 scope host
           valid_lft forever preferred_lft forever
    2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc pfifo_fast state UP group default qlen 1000
        link/ether fa:16:3e:fe:22:71 brd ff:ff:ff:ff:ff:ff
        inet 172.16.17.104/24 brd 172.16.17.255 scope global dynamic eth0
           valid_lft 85543sec preferred_lft 85543sec
        inet6 fe80::f816:3eff:fefe:2271/64 scope link
           valid_lft forever preferred_lft forever

  • 相关阅读:
    C++基础--if/else和switch/case的区别
    条件概率,联合概率,边缘概率及独立事件,古典概型
    Maven中的Archetype概念及作用用途
    Unable to execute 'doFinal' with cipher instance
    查看是否存在tomcat进程和关闭方法
    python中的‘’的作用
    sklearn中predict_proba()的用法例子(转)
    pandas.DataFrame.sample随机抽样
    最全的MonkeyRunner自动化测试从入门到精通(1)
    阿里创新自动化测试工具平台--Doom
  • 原文地址:https://www.cnblogs.com/cloud-datacenter/p/12243556.html
Copyright © 2020-2023  润新知