Never run firefox with sudo in your ubuntu install

Or, if you do, do this to undo the quagmire you just created.

Hello people,

Yesterday, I tried to run Firefox as another user with the sudo command. However, I got the syntax wrong (put the option in the wrong place) and Firefox opened as root.

Normally, that wouldn’t be too bad… I mean, just close it and try again later, when I have the syntax down.

Wrong. When I opened Firefox again from the top menu bar, it opened to a blank page. I clicked my Home button and it took me to the Firefox Start Page, when my homepage was Google.

I checked my bookmarks, and they were gone too, with a glitchy blank bookmark being the only one left.

Apparently, when you run Firefox as root, root takes ownership of several of your configuration files, including bookmarks, etc. And since the default permissions are 7/0/0, you lose your ability to open them. If you don’t believe me, try running sudo firefox again. Hey look, there’s your bookmarks and homepage!

How to fix the problem:

=First, find your .mozilla/firefox folder. It’s almost always in your /home/username folder, but you’ll need to go to View–>Show Hidden Files to be able to see it. Inside there’s a firefox folder. Right-click and Copy that.

=Now, go to your Terminal. Type the following commands in order, but replace all instances of ‘username’ with your username:

sudo chown -R username:username /home/username/.mozilla/firefox
sudo chmod -R 775 /home/username/.mozilla/firefox

Now close Terminal and open Firefox normally. Huzzah, all your stuff is back! :guitar:

Advertisements

Leave a comment

No comments yet.

Comments RSS TrackBack Identifier URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s