Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook 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.

    Advertisement

    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 Display Warning Message to Unauthorized SSH Access

    How to Set a Custom SSH Login Banner and MOTD

    Error: EACCES: permission denied, scandir (Resolved)

    Add A Comment

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • How to List Manually Installed Packages in Ubuntu & Debian
    • 10 Bash Tricks Every Developer Should Know
    • How to Validate Email Address in JavaScript
    • Firewalld: Common Firewall Rules and Commands
    • 12 Apk Commands in Alpine Linux Package Management
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

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