Skip to content

Commit

Permalink
v2024-12-27
Browse files Browse the repository at this point in the history
  • Loading branch information
Arondight committed Dec 27, 2024
1 parent 1825f2f commit d16e04d
Show file tree
Hide file tree
Showing 8 changed files with 306 additions and 400 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ tags
# dot files
.*

# zip files
*.gz

# git
!.gitignore

Expand Down
8 changes: 8 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
v2024-12-27
* git:
更新了配置文件
* ssh:
更新 ssh 密钥
* zsh:
优化了 sshenv

v2024-12-26.2
* zsh:
现在nd sshenv 生成 ed25519 密钥
Expand Down
13 changes: 9 additions & 4 deletions git/.gitconfig
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,17 @@
askPass =
editor = vim
quotepath = false
[filter "lfs"]
clean = git-lfs clean -- %f
process = git-lfs filter-process
required = true
smudge = git-lfs smudge -- %f
[gui]
encoding = utf-8
#[http]
# proxy = http://localhost:8889
# proxy = http://localhost:10809
#[https]
# proxy = http://localhost:8889
# proxy = http://localhost:10809
[i18n]
logoutputencoding = utf-8
[i18n "commit"]
Expand All @@ -58,5 +63,5 @@
default = simple
[user]
email = [email protected]
name = Qin Fandong
signingkey = B66CC194
name = 秦凡东
signingkey = 43E6919A7C6150C354A77DA9ECFF404B11F89583
18 changes: 12 additions & 6 deletions ssh/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
个人 SSH 密钥备份。
个人 SSH 密钥备份。因为 RSA 密钥已经不被支持,可能需要在 `sshd` 配置文件中配置 `PubkeyAcceptedKeyTypes +ssh-rsa`

```sh
gpg -o ./ssh-env.tar.gz -d ./ssh-env.tar.gz.asc
sshenv import ./ssh-env
rm -f ./ssh-env.tar.gz
导入。

```bash
sshenv import <(gpg --default-key $(cat ./fingerprint) -o- -d <(base64 -d ./ssh-env.tar.gz.asc.base64))
```

因为 RSA 密钥已经不被支持,需要在配置文件中添加 `PubkeyAcceptedKeyTypes +ssh-rsa`
导出。

```bash
sshenv export ssh-env
base64 >./ssh-env.tar.gz.asc.base64 < <(gpg -r $(cat ./fingerprint) -o- -ae ./ssh-env.tar.gz)
rm -f ./ssh-env.tar.gz
```
2 changes: 1 addition & 1 deletion ssh/fingerprint
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4444 9495 01B3 CC2A 7657 9C08 25FF D92A B66C C194
43E6919A7C6150C354A77DA9ECFF404B11F89583
389 changes: 0 additions & 389 deletions ssh/ssh-env.tar.gz.asc

This file was deleted.

258 changes: 258 additions & 0 deletions ssh/ssh-env.tar.gz.asc.base64

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions zsh/.zsh/sshenv/sshenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,21 @@ function _sshenvImport ()
return 1
fi

for d in $(find "${HOME}/.ssh_env/"* -maxdepth 0 -type d)
do
command chmod 700 "$d"
done

for f in $(find "${HOME}/.ssh_env/" -type f -name 'id_*.pub')
do
command chmod 644 "$f"
done

for f in $(find "${HOME}/.ssh_env/" -type f -name 'id_*' -not -name '*.pub')
do
command chmod 400 "$f"
done

return 0
}

Expand Down

0 comments on commit d16e04d

Please sign in to comment.