在 kubuntu 22.04 上我重新安装了 ssh-keygen:
sudo ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Created directory '/root/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa
Your public key has been saved in /root/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:Q40/XXXXXXXXXXXXXXXXX/XXXXXXX root@master-at-home
The key's randomart image is:
+---[RSA 3072]----+
|... .. |
|oo.+o.. o |
|.+.o=o+ = . |
| oo.o.= B |
| .. .oS B |
| o=.o. + |
| .E.+ o |
| .*+ . . |
| .o*B*o. |
但是文件是在 下生成的/root/.ssh/id_rsa.pub
,而不是在 下生成的/home/master/.ssh
, 是master
当前用户。
不确定我是否可以手动移动文件或在控制台中更改命令?
编辑信息:
master@master-at-home:/mnt/_work_sdb8/wwwroot/lar/CurrenciesXM$ ls -la ~/.ssh
total 24
drwxr-xr-x 2 root root 4096 жов 21 16:17 .
drwxr-x--- 31 master master 4096 жов 21 16:51 ..
-rwxr-xr-x 1 root root 2610 жов 29 2021 id_rsa
-rwxr-xr-x 1 root root 574 жов 29 2021 id_rsa.pub
-rwxr-xr-x 1 root root 3556 жов 21 16:17 known_hosts
-rwxr-xr-x 1 root root 3998 лис 22 2023 known_hosts.old
master@master-at-home:/mnt/_work_sdb8/wwwroot/lar/CurrenciesXM$ id
uid=1000(master) gid=1000(master) groups=1000(master),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),122(lpadmin),133(lxd),134(sambashare)
master@master-at-home:/mnt/_work_sdb8/wwwroot/lar/CurrenciesXM$ sudo -s
[sudo] password for master:
root@master-at-home:/mnt/_work_sdb8/wwwroot/lar/CurrenciesXM# id
uid=0(root) gid=0(root) groups=0(root),137(docker)