-3

I would like to create a public/private keypair and upload the public key to a server that I want to log onto.

However, that server has already been configured to allow no password authentication of any kind - only key based authentication is allowed.

How do I upload my public key to that system ? I have no way to log in ...

Just to be clear - I understand very well how to scp my public key to the remote .ssh/authorized_keys file - that is not the issue - the problem is, if password auth is disabled, how can I get the key to them in the first place ?

user227963
  • 209
  • 1
  • 2
  • 11

1 Answers1

2

If you cannot access the server through an SSH session, you will not be able to transfer your key that way.

If you have access to a local terminal or console that you CAN log into:

  1. Put the public key somewhere you can fetch it from (wget, curl, etc.) to save you some typing. This can be a Pastebin, for example.
  2. Enable password authentication so that you can deploy your key.

In the future, you may want to look into adding the keys during provisioning through any provisioning options that are available to you.