fix: 修复 authorized_keys 保存后丢失换行符的问题.

This commit is contained in:
LamGC 2023-10-23 08:21:58 +00:00
parent c19ecc0d04
commit 3fc77a32ad
Signed by: LamGC
GPG Key ID: 6C5AE2A913941E1D

2
conf-sshd.sh Normal file → Executable file
View File

@ -79,7 +79,7 @@ update_sshkeys() {
echo "-------------------- SSH Keys --------------------"
echo "$ssh_keys"
echo "--------------------------------------------------"
echo $ssh_keys > ~/.ssh/authorized_keys
echo "$ssh_keys" > ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
# 输出更新成功,需要附带时间日期
echo "SSH public key updated successfully at $(date '+%Y-%m-%d %H:%M:%S')"