-3

I have an embedded device with Linux on board and ssh daemon. Users connect to that device using public key authentication. They generate rsa keys, when send it to me and I add them to .ssh/authorized_keys on device. Everything works well, but device memory is limited and I found what it has a lot of useless keys.

So, how could I remove useless keys? Could I do something like this:

Create file username.pub what will contains username's public key, and if it will change, I simply overwrite it?

Thanks in advance.

P.S. Please, sorry for my English.

P.S.S. I'm new in this and have no time to make any research.

ArhiChief
  • 11
  • 2
  • 2
    What have you tried? Since you added the keys, I'd expect that you would at least have an ideas where to start. Also, coming here and saying "hey, help me with this, I don't have time to figure it out myself" isn't going to earn you any favors. SF is not a help desk for the Internet - we expect people to at least put some effort into their problem before coming here. – EEAA Aug 31 '15 at 13:03
  • I use 'cat username_rsa.pub | ssh b@B 'cat >> .ssh/authorized_keys'' to add new public key into device. I'm try to search something like "multiple authorized_keys files" without any results. – ArhiChief Aug 31 '15 at 13:13
  • So do you know what that command does? – EEAA Aug 31 '15 at 13:15
  • better than multiple files would be storing some comment next to the key to know who does the key belong to. – Jakuje Aug 31 '15 at 13:25
  • This command reads username_rsa.pub file, put the result into pipe and then executes cat >> .ssh/authorized_keys on remote host what writes data from pipe at the end of the file .ssh/authorized_keys. Please don't think that I'm an idiot or something like what. I'm really don't know what to do and what I have to search. – ArhiChief Aug 31 '15 at 13:29

1 Answers1

1

You can add comment at the end of public key in .ssh/authorized_keys. Something like that:

ssh-rsa <KEY>.key comment-here

It should help you mange this file.