欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

No such file or directory

程序员文章站 2022-03-08 19:26:45
...
ssh-****** -t ed25519 -C "[email protected]"
Generating public/private ed25519 key pair.
Enter file in which to save the key (/Users/fyhsurvivors/.ssh/id_ed25519): 
/Users/fyhsurvivors/.ssh/id_ed25519 already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /Users/fyhsurvivors/.ssh/id_ed25519.
Your public key has been saved in /Users/fyhsurvivors/.ssh/id_ed25519.pub.
The key fingerprint is:
SHA256:eVTC9BP7dZ4mQVyJiIrWD2xhTDzorgsZI78zTJ+zB6k [email protected]
The key's randomart image is:
+--[ED25519 256]--+
|      x. xx x.x..|
|     . * .x.x +. |
|    . x . xxx.  o|
|     x * x   .xxx|
|.x  ..x x .  ..o.|
|.x. .x   x    x  |
| .xx.x           |
|  xx .x          |
|  x.x.           |
+----[SHA256]-----+
[email protected] ~ % cat id_rsa.pub

cat: id_rsa.pub: No such file or directory

[email protected] ~ % cd ~/.ssh
[email protected] .ssh % ls
config      id_ed25519.pub  id_rsa.pub  
id_ed25519  id_rsa      known_hosts 
[email protected] .ssh % cat id_rsa.pub 
ssh-rsa xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxx= [email protected]
[email protected] .ssh % 

首先,全部操作如上,在生成 生成新的 SSH ** 后复制其公钥的时候执行 cat id_rsa.pub 抛出了 No such file or directory

其次,重新 cd 到 ssh 层级后尝试获取

cd ~/.ssh
ls

最后,成功获取到其 list 后复制其需要的 id_rsa.pub 即可.
注:需要将其 copy 至类似记事本的文本框中后再次复制至 ssh 配置处,不然可能会出现格式异常的情况.


以上便是此次分享的全部内容,希望能对大家有所帮助!

相关标签: Development ssh