Windwos笔记

文件校验

命令

1
2
3
certutil -hashfile xxx MD5
certutil -hashfile xxx SHA1
certutil -hashfile xxx SHA256

git pull报错 :文件权限问题

1
2
3
4
5
6
7
8
D:\04-github\MyHexo>git pull
hostkeys_find_by_key_hostfile: hostkeys_foreach failed for /c/Users/sevenx/.ssh/known_hosts: Permission denied
The authenticity of host 'github.com (198.18.1.15)' can't be established.
ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Failed to add the host to the list of known hosts (/c/Users/sevenx/.ssh/known_hosts).
client_input_hostkeys: hostkeys_foreach failed for /c/Users/sevenx/.ssh/known_hosts: Permission denied

查看.ssh目录下的文件权限:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
❯ la -l
ls: .nomedia: Permission denied
ls: config: Permission denied
ls: known_hosts: Permission denied
ls: known_hosts.old: Permission denied
total 20K
-rwxrwx--- 1 10074 1023 0 May 31 2024 .nomedia
---------- 1 k k 0 Apr 3 2023 config
-rwxrwxrwx 1 k k 2.6K Mar 14 2023 id_rsa
-rwxrwxrwx 1 k k 577 Mar 14 2023 id_rsa.pub
-rwxrwxrwx 1 k k 2.6K Apr 3 2023 id_rsa_encolea
-rwxrwxrwx 1 k k 572 Apr 3 2023 id_rsa_encolea.pub
---------- 1 k k 919 Apr 2 2023 known_hosts
---------- 1 k k 747 Mar 20 2023 known_hosts.old

发现known_hosts的权限不对,进入cmd修改文件权限

1
2
icacls known_hosts /inheritance:r /grant:r "%USERNAME%:(F)" 
icacls known_hosts.old /inheritance:r /grant:r "%USERNAME%:(F)"

本博客所有文章除特别声明外,均采用 CC BY-SA 4.0 协议 ,转载请注明出处!