公钥上传之后,还是要写到服务器端的authorized_keys文件里去的。 客户端登录可以指定某一个私钥文件,不指定就是使用当前用户下.ssh里的id_rsa
查了下man ssh 是这样的
-i identity_file
Selects a file from which the identity (private key) for public key authentication is read. The default is ~/.ssh/identity for protocol
version 1, and ~/.ssh/id_dsa, ~/.ssh/id_ecdsa, ~/.ssh/id_ed25519 and ~/.ssh/id_rsa for protocol version 2. Identity files may also be
specified on a per-host basis in the configuration file. It is possible to have multiple -i options (and multiple identities specified in
configuration files). If no certificates have been explicitly specified by the CertificateFile directive, ssh will also try to load cer‐
tificate information from the filename obtained by appending -cert.pub to identity filenames.
※ 修改:·loulinzheng 于 May 28 20:42:58 2023 修改本文·[FROM: 115.193.188.*]
※ 来源:·水木社区
http://www.mysmth.net·[FROM: 220.191.249.*]
修改:loulinzheng FROM 115.193.188.*
FROM 220.191.249.*