gpt4 book ai didi

permissions - ssh "permissions are too open"

转载 作者:行者123 更新时间:2023-12-03 03:51:10 27 4
gpt4 key购买 nike

我从 ssh 收到以下错误:

Permissions 0777 for '/Users/username/.ssh/id_rsa' are too open.
It is recommended that your private key files are NOT accessible by others.
This private key will be ignored.

我应该为 id_rsa 文件授予什么权限?

最佳答案

key 只能由您读写:

chmod 600 ~/.ssh/id_rsa

或者, key 只能由您读取(这也会阻止您的写入访问权限):

chmod 400 ~/.ssh/id_rsa

600 在大多数情况下似乎更好,因为您稍后不需要更改文件权限来编辑它。 (有关更多细微差别,请参阅评论)

联机帮助页中的相关部分 (man ssh)

 ~/.ssh/id_rsa
Contains the private key for authentication. These files contain sensitive
data and should be readable by the user but not
accessible by others (read/write/execute). ssh will simply ignore a private
key file if it is
accessible by others. It is possible to specify a
passphrase when generating the key which will be used to encrypt the sensitive
part of this file using 3DES.

~/.ssh/identity.pub
~/.ssh/id_dsa.pub
~/.ssh/id_ecdsa.pub
~/.ssh/id_rsa.pub
Contains the public key for authentication. These files are not sensitive and
can (but need not) be readable by anyone.

关于permissions - ssh "permissions are too open",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9270734/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com