Windows CHMOD 600

前端 未结 12 1466
逝去的感伤
逝去的感伤 2020-12-24 11:11

I\'m trying to connect to Amazon EC2 using OpenSSH in windows but I need to set the permissions of my key file.

What is the windows equivalent of CHMOD 600

12条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-24 11:33

    I prefer Cygwin over putty and you can just run chmod command in cygwin to change the permission of PEM key to be 400, then you are good to go.

    myuser@myuser-HP ~
    $ ssh -i /cygdrive/c/Users/myuser/Downloads/mykey.pem ec2-user@xx.xx.xx.xx
    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    @         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    Permissions 0550 for '/cygdrive/c/Users/myuser/Downloads/mykey.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 "/cygdrive/c/Users/myuser/Downloads/mykey.pem": bad permissions
    Permission denied (publickey).
    
    myuser@myuser-HP ~
    $ chmod
    chmod: missing operand
    Try 'chmod --help' for more information.
    
    myuser@myuser-HP ~
    $ chmod 400 /cygdrive/c/Users/myuser/Downloads/mykey.pem
    
    myuser@myuser-HP ~
    $ ssh -i /cygdrive/c/Users/myuser/Downloads/meykey.pem ec2-user@xx.xx.xx.xx
    
           __|  __|_  )
           _|  (     /   Amazon Linux AMI
          ___|\___|___|
    
    https://aws.amazon.com/amazon-linux-ami/2015.09-release-notes/
    [ec2-user@ip-xxx ~]$ ohyeah I am in!
    

提交回复
热议问题