zoukankan      html  css  js  c++  java
  • Fixing “WARNING: UNPROTECTED PRIVATE KEY FILE!” on Linux

     

    If you are getting this error then you probably reset the permissions on your hidden .ssh directory in your user folder, and your keys aren’t going to work anymore. It’s very important that these files not be writable by just anybody with a login to the box, so openssh will give you an error if you try to use them.

    The full error message:

    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    @         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    Permissions 0744 for '/home/geek/.ssh/id_rsa' are too open.
    It is recommended that your private key files are NOT accessible by others.
    This private key will be ignored.
    bad permissions: ignore key: /home/geek/.ssh/id_rsa

    To fix this, you’ll need to reset the permissions back to default:

    sudo chmod 600 ~/.ssh/id_rsa
    sudo chmod 600 ~/.ssh/id_rsa.pub

    If you are getting another error:

    Are you sure you want to continue connecting (yes/no)? yes
    Failed to add the host to the list of known hosts (/home/geek/.ssh/known_hosts).

    This means that the permissions on that file are also set incorrectly, and can be adjusted with this:

    sudo chmod 644 ~/.ssh/known_hosts

    Finally, you may need to adjust the directory permissions as well:

    sudo chmod 755 ~/.ssh
  • 相关阅读:
    Java Web三层架构设计深思
    编译C源码软件需要的工具
    Hibernate之表间关系
    CSS之颜色字体
    主流的微服务框架
    CSS布局思考
    Android创建新项目及开发
    Google工程师解析Android系统架构
    java多线程实用操作
    Spring IOC/DI/注解
  • 原文地址:https://www.cnblogs.com/UnGeek/p/5940007.html
Copyright © 2011-2022 走看看