-1

I've got two accounts which are used for automated file uploads on a server and company policy requires that they are updated after 3 years. I wasn't here 3 years ago and I've not done this before.

I don't understand how to create the SSH keys for two separate accounts. The .ssh directory has the id_rsa keys, but there's no specifying which user account is needed. From what I've read, I believe the keys would need to go into the .ssh folder for the associated account but I've been informed that the keys are under a further account, different to the two above.

I hope this isn't too confusing, I can't really give specific details without potentially compromising our security.

4
  • Ask a colleague ?
    – user9517
    Oct 12, 2015 at 11:26
  • None of my colleagues have done this either unfortunately!
    – Paul Dunn
    Oct 12, 2015 at 11:30
  • And there is no documentation to accompany such an important policy ?
    – user9517
    Oct 12, 2015 at 11:36
  • No. Process in the past (and documentation) has been terrible and I've been landed with it.
    – Paul Dunn
    Oct 12, 2015 at 11:50

1 Answer 1

-1

Usually key creation can be done by the following steps. Perhaps this will help you achieve your goal.

  1. Create new keys with

    ssh-keygen -t rsa
    
  2. Insert the content of id_rsa.pub into the authorized_keys file under /home/user/.ssh/authorized_keys - might be called authorized_keys2

    cat id_rsa.pub > /home/user/.ssh/authorized_keys (this will overwrite the current content of authorized_keys
    
  3. copy/download id_rsa to your client and connect to your account using the key.

In case you need ppk keys, you can use PuTTYgen in order to convert your key above.

3
  • This is shaky advice to follow for an existing production system. For starters, you want your keys backed up before generating a new pair. Second, do NOT overwrite your existing authorized_keys with a > -- instead use >> to append and then go back and clean up old entries later. Third, the OP seems a little uncertain about how is system is working -- step 3 could be difficult without some idea of exactly where to put the new key. Oct 12, 2015 at 12:08
  • I'm not sure this would allow me to create separate keys for the two account? And how is it specified that the key is for that account? There's also no authorized_keys or authorized_keys2 file in the .ssh directory.
    – Paul Dunn
    Oct 12, 2015 at 12:20
  • @BrandonXavier. I just wanted to some shed lights on how the keypair-thing worked as he seemed very inexperienced in general. 1) i agree that this can overwrite your current keys if you generate the keys from the user in question 2) I do state that this overwrites. 3) I have no clue what app he uses as a client? Oct 12, 2015 at 12:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .