Facebook X (Twitter) Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook X (Twitter) Instagram
    TecAdmin
    You are at:Home»Network Services»SSH»SSH – permissions are too open.

    SSH – permissions are too open.

    By RahulJuly 27, 20222 Mins Read

    I have launched a new Linux instance in my AWS account and downloaded the private key file. As we all know, AWS only allows default key-based SSH authentication. When I tried to SSH with the downloaded private key file, I got the a warning message Permissions 0644 for ‘server.pem’ are too open and it prompted for the password.

    In this faq, you will learn to fixe WARNING: UNPROTECTED PRIVATE KEY FILE! error in Linux.

    The Problem:

    The error looks like the below:

    ssh -i server.pem [email protected]
    
    Output
    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: UNPROTECTED PRIVATE KEY FILE! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Permissions 0644 for 'server.pem' are too open. It is required that your private key files are NOT accessible by others. This private key will be ignored. bad permissions: ignore key: server.pem [email protected]'s password:

    I was aware of this issue, so I got it fixed easily. If we read the error message carefully, we will understand that there are some issues with the permissions on the server.pem file.

    So this tutorial is for our readers to quickly solve this issue without wasting their time. Thanks

    The Solution:

    As per security policy, the private key file must not be publicly viewable in order to successfully log in to the server using SSH protocol. So you need to change the file permissions to restrict access to the owner only. The owner only required the read permission to use this file during an ssh connection. Change the file permissions with the following command:

    chmod 400 server.pem 
    

    Now try to ssh with the same command and same key file.

    ssh -i server.pem [email protected] 
    

    You will be able to ssh properly to the remote server without any error message.

    error private key SSH warning
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    How to Avoid the SSH Broken Pipe Error

    Setting Up Ubuntu Docker Container with SSH Access

    A Practical Guide to Disabling SSH Timeout

    Add A Comment

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • Using .env File in FastAPI
    • Setting Up Email Notifications for Django Error Reporting
    • How to Enable Apache Rewrite (mod_rewrite) Module
    • What are Microservices?
    • Variable Expansion in ZSH
    Facebook X (Twitter) Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.