Laravel Forge Permission denied (publickey).

January 11, 2015 5k views


I was subscribed to Laravel Forge couple weeks ago, now I canceled my subscription and I can't access to my server using SSH.

Don't know if it's related to canceling subscription.

I'm noob to SSH, I only used it once I started to use Forge so I don't know what could be the problem.

I always get this error: Permission denied (publickey).

Can someone help me.

2 Answers

I think you can renable password authentication by going to the ssh config file and executing the following code. (Access your server by using the console on the DO control panel.)

nano /etc/ssh/sshd_config 

Once in the file find a section that look like this and change no to yes

PasswordAuthentication no

Save the file and reload ssh config with this

 /etc/init.d/sshd restart 

Now, I wouldn't recommend for you to keep it this way but at least now you can access ssh normally and setup new keys for you server. Once you setup new keys just go back into the configuration file and change 'yes' back to 'no'

Hope this helps

Good Luck!

Have you try accessing the server through the DO console in the control panel? if not, try loggin in there and see if you can.

  • I tried and I can login with no problems

  • I have never use laravel forge, but I think they create a specific user for laravel forge. are you using that user to try to login or are you using root?

  • They create "forge" user, and yes, I'm using that user and password which is created by Laravel Forge.

  • Forge only allows SSH key login, so you won't be able to use your password to log in via SSH. Do you still have access to your SSH key?

  • Now I noticed that my id_rsa file is missing. Can I restore SSH key from Digital Ocean?

Have another answer? Share your knowledge.