Forum Discussion

Laurent_Philipp's avatar
Laurent_Philipp
Icon for Nimbostratus rankNimbostratus
Jun 25, 2015

Configure SSH public key with LROS

I am trying to configure a public SSH key for Linerate. According to /etc/ssh/sshd_config it needs to be configured under /var/run/sshd_authorized_keys.d/ However I can't write files in that directory although I am logged as root and have 'w' permission. On the other hand I have not found any means to configure this from the CLI configure command. How should this be done? Thank you.

 

2 Replies

  • Additional note: I also have a similar problem with the /home/linerate/data directory which has rwxr-xr-x permission but I can't read nor write any file in that directory although I am logged in as user=root, group=lros (same as the data/ directory). I checked ACLs are okay and the filesystem is mounted as rw.
  • I'm not sure why, or how you are logged in as root, but if you

    ssh admin@hostname
    , you are dropped at the
    LROS 
    prompt. If you then type
    bash
    , you will be dropped into a bash shell as the admin user. You can then run commands using
    sudo
    , which will give you permission to write to the file you need to write to:
    sudo vim /var/run/sshd_authorized_keys.d/admin
    .

    I just did this on a 2.6.1 installation and it works very nicely. I'm not sure whether the

    /var/run
    directory will persist between reloads, though. I still need to test that. This comment makes me think that it might be possible to configure this through LROS, but I haven't been able to find a command or any other documentation:

     The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2
     but this is overridden so installations will only check the LROS managed dir
    AuthorizedKeysFile      /var/run/sshd_authorized_keys.d/%u