MONDAY 8AM AND IM LOCKED OUT OF A FRESHLY BUILT UBUNTU VM

Solvedauthenticationlinuxssh7 replies · 320 views · started
Accepted solution by Caleb Zhang — sshd is strict about permissions (StrictModes yes). on the server: chmod 700 /.ssh, chmod 600 /.ssh/authorized keys, and teh home…
  1. im literally losing my mind here my key works on every other server. On a freshly built Ubuntu VM, from a CI job, nothing:

    This app can't run on your PC

    This app can't run on your PC
    
    To find a version for your PC, check with the
    software publisher.
    

    A colleague set up the account... they swear they pasted my key... im starting to suspect the server, but i dont even know where to look.

    Its frustratnig because i cant see anything on teh server side, and the error message is the same for every possible mistake. Is there a way to get more detail from the client at least? seriously need help here 😭

    4
  2. Watch the username. Cloud images use default users like ubuntu, ec2-user, admin or debian. Connecting as root or your own name with a key that's only in the default user's authorized_keys fails with exactly this error.

    2 2 helpful
  3. ok so run the client in verbose mode first:

    ssh -vvv user@host
    

    Look for Offering public key: lines. If your key is never offered, the client isnt using it: pass -i ~/.ssh/id_ed25519 or set IdentityFile in ~/.ssh/config. If its offered and rejected, the server side is the problem.

    0 5 helpful
  4. sshd is strict about permissions (StrictModes yes). on the server: chmod 700 ~/.ssh, chmod 600 ~/.ssh/authorized_keys, and teh home directory must not be group- or world-writable. Ownership must be teh user, not root. worked for me anyway 🤷

    2 8 helpful
  5. make a backup before u touch the BIOS, learned that the hard way hope that helps :)

    1 7 helpful
  6. spent half the night on linux and im still not done thx in advance!!

    5 1 helpful
  7. @caleb_silicon holy cow fixed the home directory permissions and the key was accepted instantly. strictModes strikes again.

    12 0 helpful

Reply to this topic

Sign in or create an account to reply.