使用 Win10 下的 Ubuntu 子系统的时候,把秘钥直接扔进去总是有问题,后来发现是文件的权限问题,故写个 note 记录一下。

Private / Public Key Permission

Should be 600 (Read / Write by current user ONLY).

1
2
$ sudo chmod 600 ~/.ssh/id_rsa
$ sudo chmod 600 ~/.ssh/id_rsa.pub

Known_hosts Permission

Should be 644 (Read / Write by current user & Read ONLY by other users).

1
$ sudo chmod 644 ~/.ssh/known_hosts

.ssh Directory Permission

Should be 755 (Read / Write / Execute by current user & Read / Execute by other users).

1
$ sudo chmod 755 ~/.ssh

SSH files permission resolved :)


知识共享许可协议
本作品采用知识共享署名-相同方式共享 4.0 国际许可协议进行许可。