WARNING: UNPROTECTED PRIVATE KEY FILE!

  • An error is reported when the command access key ( rsa, key...) is executed:

    Error: 
    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    @         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    Permissions for './key/private.xxxx.key' are too open.
    It is required that your private key files are NOT accessible by others.
    This private key will be ignored.
    Load key "./key/private.xxxx.key": bad permissions
        at t.Project.getPrivateKey (/Users/dengzemiao/Desktop/GitHub/DZMKs-cli/node_modules/ks-miniprogram-ci/dist/index.js:2086:6544665)
        at new t.Project (/Users/dengzemiao/Desktop/GitHub/DZMKs-cli/node_modules/ks-miniprogram-ci/dist/index.js:2086:6543572)
        at run (/Users/dengzemiao/Desktop/GitHub/DZMKs-cli/index.js:57:18)
        at Object.<anonymous> (/Users/dengzemiao/Desktop/GitHub/DZMKs-cli/index.js:44:2)
        at Module._compile (node:internal/modules/cjs/loader:1196:14)
        at Object.Module._extensions..js (node:internal/modules/cjs/loader:1250:10)
        at Module.load (node:internal/modules/cjs/loader:1074:32)
        at Function.Module._load (node:internal/modules/cjs/loader:909:12)
        at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
        at node:internal/main/run_main_module:22:47
    
  • This means that the permission of the key file cannot be 0644, 0644the permission is too open, and the key file cannot be read by other users, and the permission is too wide, and it needs to be set to be visible only to the user.

  • In the linuxor macsystem, only chmodthe command is needed to complete the setting, the command is as follows:

    # 对指定文件或文件夹添加权限(这个错误 600 、700 权限都能解决)
    $ chmod 700 xxx
    
    # 例如
    $ chmod 700 ./key/private.xxxx.key
    
    -rw------- (600) 只有拥有者有读写权限。
    -rw-r--r-- (644) 只有拥有者有读写权限;而属组用户和其他用户只有读权限。
    -rwx------ (700) 只有拥有者有读、写、执行权限。
    -rwxr-xr-x (755) 拥有者有读、写、执行权限;而属组用户和其他用户只有读、执行权限。
    -rwx--x--x (711) 拥有者有读、写、执行权限;而属组用户和其他用户只有执行权限。
    -rw-rw-rw- (666) 所有用户都有文件读、写权限。
    -rwxrwxrwx (777) 所有用户都有读、写、执行权限。
    
  • windowsYou can see this article to solve it.

Guess you like

Origin blog.csdn.net/zz00008888/article/details/131771328