Skip to content
Advertisement

Login as root using Laravel Forge

I have executed a recipe on a server at Laravel Forge. The recipe is for some reason run as root. When connecting to the server through ssh, I use user forge. But since the recipe was run as root, I cannot access some processes. My first thought was to log in as root, but I think Forge has disabled that. Using ssh root@ip results in Permission denied (publickey).

How do I login as root using Forge?

Edit: Apparently, on Forge, you can chose the user on which the recipe is run.

Advertisement

Answer

I ended up first adding forge ALL = NOPASSWD : ALL via sudo visudo and then adding an alias for ssh -t forge@ip "sudo -i".

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement