Help setting up public key auth for ssh


LMon

Recommended Posts

I've been banging my head against this for a couple of hours. Hopefully someone can help me out here.

 

I want to restrict my ssh log in to public key only but I can't get it to work without getting in first and doing a ssh-add manually.

Doing it in the go file doesn't work on boot, but does when I run the go file manually from a login.

 

I have modified ssh_config to accept PubkeyAuthentication

I have my public key stored in /boot/config/ssh.

It is copied as ~/.ssh/authorized_keys via the go file.

permissions on ~/.ssh are drwx------

permissions on ~/.ssh/authorized_keys are -rw-------

 

What is the correct way to add the key on boot?

 

I'm not that familiar with setting up ssh so if there's anything else I'm overlooking please let me know.

 

Edit: Turns out I was just being impatient. Waiting a bit longer allowed for a public key login, when I could login by password straight away.

Link to comment
  • 2 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.