编辑 最后修改时间 2023/07/21 15:39
ssh登录配置-authorized_keys
authorized_keys id_rsa.pub ssh秘钥 公钥
生成公钥
$ ssh-keygen -t rsa -b 2048 ; cat ~/.ssh/id_rsa.pub
创建公钥存放目录
~/.ssh/authorized_keys
// 创建.ssh目录
$ cd ~ ; mkdir .ssh
$ chmod go= .ssh
// 创建公钥存放文件
$ cd ~/.ssh ; touch authorized_keys
$ chmod u=rw,go=r authorized_keys
设置公钥
把生成的公钥追加写入要登录主机的
authorized_keys
$ cat 'ssh-rsa AAAAB3...== rsa 2048-020421' >> ~/.ssh/authorized_keys
更改现有私钥的密码而无需重新生成密钥对
$ ssh-keygen -p -f ~/.ssh/id_ed25519
Enter old passphrase: [Type old passphrase]
Key has comment 'your_email@example.com'
Enter new passphrase (empty for no passphrase): [Type new passphrase]
Enter same passphrase again: [Repeat the new passphrase]
Your identification has been saved with the new passphrase.
另外补充一个远程控制sh
GitHub地址 https://github.com/sxin0/so