1

I am trying to start firefox from terminal using this command sudo /usr/bin/firefox. The problem is that it won't open firefox returning me this error:

mkdir: cannot create directory '/run/user/0': Permission denied
Authorization required, but no authorization protocol specified
Error: cannot open display: :0

Does anyone know how I can fix this? Thank you.

Harry
  • 21
  • 1
  • 1
  • 3

1 Answers1

6

The "sudo" command is used to temporarily grant administrator (root) permission, but running a web browser with the root user is not recommended and generally not necessary, considering that you don't need to be an administrator to browse the internet.

You can start firefox via command line with command /usr/bin/firefox & or just firefox &

The character "&" after the name of the executable guarantees that it will not terminate when the terminal session is closed or if you press the key combination CTRL + C, because with the character & the application will remain running in the background.

Running programs in the background from terminal