0

If I'm using openssh server, allowing multiple public keys are simple. It is enough put it into file ~/.ssh/authorized_keys with content

ssh-rsa ****there_is_public_ssh_key****  some_text_typically_user@host
ssh-rsa  *****second_pub_key****  another_text
...

But how to do it with proftpd with sftp protocol? Typical configuration for single public key is, base config for virtual or global:

SFTPAuthorizedUserKeys file:/some_key_ssl_store/%u/autorized_keys

with example autorized_keys file content:

---- BEGIN SSH2 PUBLIC KEY ----
Comment: "some comment"
*****public_key_splitted_with_some_lines*****
****second line for the same key ******
****third line*****
****as many lines as is needed *****
***last_line***==
---- END SSH2 PUBLIC KEY ----

How could I store second key? Should I insert next block BEGIN to END after this example? Unfortunately I didn't find clear explanation for this one.

Currently I'm using workaround with many users with the same UID's , but this is not so clear config.

Znik
  • 348
  • 1
  • 3
  • 12

1 Answers1

1

Yes, you will need to separate each key with ----BEGIN SSH2 PUBLIC KEY----- and -----END SSH2 PUBLIC KEY----- lines. Those markers are how parsers of that file know when a given key starts/ends.

Thus, for example:

---- BEGIN SSH2 PUBLIC KEY ----
Comment: "4096-bit RSA, converted from OpenSSH by castaglia"
AAAAB3Nza...
...
1e1YNo9hYjE=
---- END SSH2 PUBLIC KEY ----
---- BEGIN SSH2 PUBLIC KEY ----
Comment: "2048-bit RSA, converted from OpenSSH by castaglia"
AAAAB3Nza..
...
Byq2pv4VBo953gK7f1AQ==
---- END SSH2 PUBLIC KEY ----

Hope this helps!

Castaglia
  • 3,349
  • 3
  • 21
  • 42