Is it possible to connect to a server using a public key? The server holds the private key in authorized_keys
, and the client can connect with: ssh -i id_rsa.pub server
It is the exact opposite as the usual way with public/private keys: the client keeps the public key, and the server holds the private key.
Now the reason: For machines being deployed to customers, I want to setup a remote connection to rescue the machines in case of problems.
ssh -i id_rsa.pub -NR 64000:localhost:22 rescue@server
) /bin/false
) ssh -i id_rsa -p 64000 localhost
). You can't use keys to authenticate in opposite order of private/public, because of the way how asymmetric cryptography works.
The alternative solution for you can be to use openssh certificates as described in manual pages and many how-to's.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.