ssh-keygen -t rsa -b 4096 -C "[email protected]"
...
Enter a file in which to save the key (/home/you/.ssh/algorithm): <key_name>
Enter passphrase (empty for no passphrase): [输入密码]
Enter same passphrase again: [再次输入密码]
cat ~/.ssh/<key_name>.pub
Title : 为新密钥添加描述性标签 Key : 粘贴COPY的公钥内容
cd ~/.ssh
# 设置访问权限
chmod 600 <key_name>
# 生成SSH配置文件
cat > config << EOF
Host github.com
Hostname ssh.github.com
Port 443
IdentityFile ~/.ssh/<key_name>
UpdateHostKeys yes
Compression yes
User git
EOF
ssh -T [email protected]
...
Are you sure you want to continue connecting (yes/no)? <yes>
...
Hi <username>! You've successfully authenticated, but GitHub does not provide shell access.
如果找不到软件,直接下载安装 或 更换软件源 Linux 版本库管理
# debian
apt install -y systemd-timesyncd
# almalinux
# systemd 是默认安装且无法卸载的核心基础包
# 设置时区
timedatectl set-timezone Asia/Shanghai
# 启动NTP服务
timedatectl set-ntp true
; debian
; /etc/systemd/timesyncd.conf
[Time]
NTP=ntp.ntsc.ac.cn
FallbackNTP=ntp.aliyun.com ntp.tencent.com 0.cn.pool.ntp.org
# debian
# 在LXC、Docker 或某些 VPS 环境中
dpkg-reconfigure tzdata
systemctl stop 'postfix@*' ; systemctl disable 'postfix@\x2a' ;
# debian
apt purge -y postfix
# almalinux
dnf remove -y postfix