-1

We are trying to patch an issue we are having with some file systems by making SSH work without the permission validation on the SSH private key.

Error message: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: UNPROTECTED PRIVATE KEY FILE! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

For some odd reasons, we are not able to change the access rights to some files (Welcome to the Cygwin world of Windows)

Anyone know if there is a way to bypass the ssh validation through whatever way? I did not find anything relevant in the ssh options.

If you are to reply chmod 400 or 600 it is not what I am looking for!

1
  • 4
    If chmod 600 [file] doesn't work under Cygwin, then your Cygwin install is broken. What happens when you try it? What version of Cygwin are you running? Commented May 28, 2013 at 16:23

3 Answers 3

3

Anyone know if there is a way to bypass the ssh validation through whatever way?

Your question makes zero sense in this situation... you're receiving an error due to wrong permissions and/or ownership of the key, as keys must only be accessible to the user they're intended for and no other account, service, or group:

  • GUI:
    [File] PropertiesSecurityAdvanced
    1. Owner: Change → Select a principal → Enter key's user → OK
    2. Permission Entries: Remove all except for the key's user
    3. Set key's user to Full Control if not already set
      1. Select user → Modify → Full Control → OK
        OR
      2. Add → Select a principal → Enter key's user → OK
    4. OK → OK

  • Cmd:
    ::# Set Key File Variable:
        Set Key="%UserProfile%\.ssh\id_rsa"
    
    ::# Remove Inheritance:
        Icacls %Key% /c /t /Inheritance:d
    
    ::# Set Ownership to Owner:
        Icacls %Key% /c /t /Grant %UserName%:F
    
    ::# Remove All Users, except for Owner:
        Icacls %Key%  /c /t /Remove Administrator BUILTIN\Administrators BUILTIN Everyone System Users
    
    ::# Verify:
        Icacls %Key%
    
    ::# Remove Variable:
        set "Key="
    
    

  • PowerShell:
    # Set Key File Variable:
      New-Variable -Name Key -Value "$env:UserProfile\.ssh\id_rsa"
    
    # Remove Inheritance:
      Icacls $Key /c /t /Inheritance:d
    
    # Set Ownership to Owner:
      Icacls $Key /c /t /Grant $env:UserName:F
    
    # Remove All Users, except for Owner:
      Icacls $Key  /c /t /Remove Administrator BUILTIN\Administrators BUILTIN Everyone System Users
    
    # Verify:
      Icacls $Key
    
    # Remove Variable:
      Remove-Variable -Name Key
    
    

  • WSL/Cygwin:
    # Set Variables:
      # Key File:
        key="/path/to/key"
    
      # User:
        user="$(echo $USER)"
    
    # Set Ownership to Owner: (assumes user's name is also user's group name)
      chown $user:$user $key
    
    # Set Access Rights
      chmod 0600 $key
    
    # Verify
      ls -l $key
    
    
2
  • This CLI solution worked for me on Windows 10 Bash (WSL) where all the point and click solutions failed. Thanks!
    – rer
    Commented Aug 17, 2018 at 0:14
  • No problem at all =] Just a FYI (as I've been seeing many users trying to share an SSH key within a Windows directory with WSL): Sharing file access between Windows <-> WSL with a file that must only be accessible to a specific user, and that user only, is not supported. Anyone utilizing WSL should read this answer and the Windows Developer Blog post: Do not change Linux files using Windows apps and tools**
    – JW0914
    Commented Aug 17, 2018 at 11:48
0

I'm not sure if you understand what this message means or what you are asking for.

Basically, SSH is telling you that your private key, which in this case as it's not owned by you, is public. That means in plan English: "Your password is in plain text. Everyone who has access to this box has access to it."

You want SSH to ignore this but SSH was design to be safe and secure. As you were told: if you can't change permissions on this file you have not installed cygwin correctly.

Could you please explain why you want to override this warning?

You can always install telnet-server

3
  • I am trying to slowly move out users from static passwords to ssh keys . I prefer them to have them have an insecure ssh key on their desktop than sharing passwords by email (as it is currently done)
    – Thierry
    Commented May 28, 2013 at 20:38
  • Again, try fixing real problem. (chmod 600). When your car is telling you that it's low on petrol do you mask it with the tape? Please post output of the chmod 600 on your folder/key file. Remember that ssh files are stored in .ssh!
    – Chris
    Commented May 28, 2013 at 21:12
  • telnet provides no means of securing the connection and should never be utilized, unless whatever ancient system one is working on only offers remote access via telnet (at which point, the ancient system should be upgraded rather than utilizing a known exploitable method)
    – JW0914
    Commented Jul 9, 2018 at 19:49
0

I had the exact same issue with Cygwin and managed to get through it by editing the key file properties in my windows explorer (Properties-Security-Advanced) and removed all groups left only my user name on it and set it up as read only.

-r-------- 1 antonio Domain Users 1692 Jan 15 19:22 AWS_Antonio.pem

That solved the issue for me. Inspired on this article. Windows SSH: Permissions for 'private-key' are too open

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .