5

So, for some reason I deleted my servers forge accounts SSH keys and created new ones. Now Laravel forge still has the old public key and it's the same it added to github. Is there a way to update the public ssh key that forge uses for my server

Evans M.
  • 1,791
  • 16
  • 20

2 Answers2

0

If you have deleted only keys, not the whole user, you just needs to add public key again to the authorized_keys file.

sudo su forge
nano ~/.ssh/authorized_keys
lchachurski
  • 1,770
  • 16
  • 21
  • 1
    I already recreated the server.. - what I was looking for is a way to update the public key that forge website adds to Github for automatic deployments – Evans M. May 28 '17 at 17:23
  • hi @EvansM. did you figure it out, could you answer your own question for all travelers from the future? :) – niko craft Oct 27 '18 at 00:14
0

Stole a script on how laravel forge itself is setup

# generate new ssh key
ssh-keygen -f /home/forge/.ssh/id_rsa -t rsa -N ''

# Copy Source Control Public Keys Into Known Hosts File

ssh-keyscan -H github.com >> /home/forge/.ssh/known_hosts
ssh-keyscan -H bitbucket.org >> /home/forge/.ssh/known_hosts
ssh-keyscan -H gitlab.com >> /home/forge/.ssh/known_hosts
Evans M.
  • 1,791
  • 16
  • 20