access permission of firefox profile on linux OS

Discuss various technical topics not related to Mozilla.
esolve
Posts: 29
Joined: April 2nd, 2011, 10:56 am

access permission of firefox profile on linux OS

Post by esolve »

I downloaded a firefox linux package
uncompress it and put it under my home dir
when I 'cd' into firefox and run the following command with my user account "esolve"

Code: Select all

./firefox

it works fine
but when I switch to root account, and run

Code: Select all

sudo -u esolve ./firefox

I see the errors below, and firefox can't be opened, THEN I tried to modify the package owner: chown -R esolve:esolve firefox, the error persists and firefox still can't be opened

Code: Select all

Error: Access was denied while trying to open files in your profile directory


if I just run it as root account, there will be errors but firefox can still be opened

I tried the same version of firefox package in another linux machine before and when I'm with root account
"sudo -u esolve ./firefox " works fine
what is wrong with this? it is strange

coz I need to use "sudo -u esolve ./firefox " in a script, otherwiser I will just switch to esolve and run ./firefox
so I hope to deal with this error
Last edited by esolve on November 14th, 2012, 5:39 am, edited 3 times in total.
User avatar
patrickjdempsey
Posts: 23686
Joined: October 23rd, 2008, 11:43 am
Location: Asheville NC
Contact:

Re: Access was denied while trying to open files in your pro

Post by patrickjdempsey »

Try editing your title to include "*NIX" to attract members more likely to know.
Tip of the day: If it has "toolbar" in the name, it's crap.
What my avatar is about: https://addons.mozilla.org/en-US/seamonkey/addon/sea-fox/
esolve
Posts: 29
Joined: April 2nd, 2011, 10:56 am

Re: Access was denied while trying to open files in your pro

Post by esolve »

patrickjdempsey wrote:Try editing your title to include "*NIX" to attract members more likely to know.


NIX?
what does that mean?
User avatar
Frank Lion
Posts: 21178
Joined: April 23rd, 2004, 6:59 pm
Location: ... The Exorcist....United Kingdom
Contact:

Re: Access was denied while trying to open files in your pro

Post by Frank Lion »

esolve wrote:
patrickjdempsey wrote:Try editing your title to include "*NIX" to attract members more likely to know.


NIX?
what does that mean?

It's an incorrect shorthand sometimes used around here. Just put 'Linux' in your thread title.

http://en.wikipedia.org/wiki/Unix
"The only thing necessary for the triumph of evil, is for good men to do nothing." - Edmund Burke (attrib.)
.
esolve
Posts: 29
Joined: April 2nd, 2011, 10:56 am

Re: access permission of firefox profile on linux OS

Post by esolve »

maybe the problem is sudo -u user_account command is different from running the command directly under the user_account?
User avatar
LIMPET235
Moderator
Posts: 39961
Joined: October 19th, 2007, 1:53 am
Location: The South Coast of N.S.W. Oz.

Re: access permission of firefox profile on linux OS

Post by LIMPET235 »

Moving to the Tech forum...
[Ancient Amateur Astronomer.]
Win-10-H/64 bit/500G SSD/16 Gig Ram/450Watt PSU/350WattUPS/Firefox-115.0.2/T-bird-115.3.2./SnagIt-v10.0.1/MWP-7.12.125.

(Always choose the "Custom" Install.)
esolve
Posts: 29
Joined: April 2nd, 2011, 10:56 am

Re: access permission of firefox profile on linux OS

Post by esolve »

ah, I solved this problem, just add --profile profile_dir
to specify the profile location
it is strange that when using sudo -u esolve, it can't locate the profile directory
User avatar
Grumpus
Posts: 13246
Joined: October 19th, 2007, 4:23 am
Location: ... Da' Swamp

Re: access permission of firefox profile on linux OS

Post by Grumpus »

More than likely root is a separate user than your home account identity and you may have to log in as root, therefore Firefox has to be installed under the root account file tree. Usually it is and you only need to log in as "root" and use the root password to access the files. This is not really a good idea since logging in as root causes a promiscuous condition and you have admin privileges globally while on line and could be a security issue.Most of the Linux Debian OS variations have some form of "plumbing" , symlinks, which allow the main file structure to communicate with the "Home" or "User" file setup, some do not. If you had a distribution modified version of Firefox installed more than likely the new install would have picked up on the profile though some of the folder directed commands may go to different folder. You might have to do some simple folder adding, editing or moving around of individual files.

Frankly I would avoid logging in as root unless you are maintaining a network and have full knowledge of what you are about. Then again I'm not the brightest penny in this roll.
Doesn't matter what you say, it's wrong for a toaster to walk around the house and talk to you
milomak
Posts: 79
Joined: August 8th, 2008, 4:01 pm

Re: access permission of firefox profile on linux OS

Post by milomak »

out of interest why are you running firefox via sudo and still using your esolve account?

as stated by Grumpus above it really isn't advisable to use firefox with root privileges.
esolve
Posts: 29
Joined: April 2nd, 2011, 10:56 am

Re: access permission of firefox profile on linux OS

Post by esolve »

esolve is not my root account
that is why I run sudo -u esolve

milomak wrote:out of interest why are you running firefox via sudo and still using your esolve account?

as stated by Grumpus above it really isn't advisable to use firefox with root privileges.
VanillaMozilla
Posts: 13808
Joined: November 7th, 2005, 11:26 am

Re: access permission of firefox profile on linux OS

Post by VanillaMozilla »

Maybe sudo just switches user for purposes of accessing the executable file, but the user domain does not extend to all actions taken by the program. Sounds like maybe a bug in sudo -- especially since you say it works in other Linices. One wonders if other programs show the same behavior.

Oh wait. You just established that sudo allows it to access the profile files, so I don't see how it could be a sudo bug. On the other hand you say [exactly the same?] Firefox works this way on other Linices. Conflicting evidence. I don't have a clue.
User avatar
Frenzie
Posts: 2135
Joined: May 5th, 2004, 10:40 am
Location: Belgium
Contact:

Re: Access was denied while trying to open files in your pro

Post by Frenzie »

Frank Lion wrote:It's an incorrect shorthand sometimes used around here. Just put 'Linux' in your thread title.

http://en.wikipedia.org/wiki/Unix

To be fair the BSDs are much the same but not Linux, as are all the other Unix-like systems. Apparently *nix or Un*x is used because UNIX is a protected trademark.

As for the problem I have no idea; got any particularly obvious differences between the two Linux machines? (Linux distro, sudo version…)
Intelligent alien life does exist, otherwise they would have contacted us.
User avatar
Frank Lion
Posts: 21178
Joined: April 23rd, 2004, 6:59 pm
Location: ... The Exorcist....United Kingdom
Contact:

Re: Access was denied while trying to open files in your pro

Post by Frank Lion »

Frenzie wrote:To be fair the BSDs are much the same but not Linux, as are all the other Unix-like systems. Apparently *nix or Un*x is used because UNIX is a protected trademark

Didn't even the Linux using OP not knowing that 'Nix' was supposed to point people to a Linux related thread, tell you something? The simplest, easiest to understand solutions are best, which is why Mac threads have Mac in the title and not Sboj.
"The only thing necessary for the triumph of evil, is for good men to do nothing." - Edmund Burke (attrib.)
.
User avatar
Frenzie
Posts: 2135
Joined: May 5th, 2004, 10:40 am
Location: Belgium
Contact:

Re: access permission of firefox profile on linux OS

Post by Frenzie »

esolve, I just thought of something else: have you tried using one of the specifically GUI-oriented tools such as gksudo or kdesudo?

Frank Lion wrote:Didn't even the Linux using OP not knowing that 'Nix' was supposed to point people to a Linux related thread, tell you something?

Yes, that it's probably not the most helpful — not whether it's correct or incorrect. :)
Intelligent alien life does exist, otherwise they would have contacted us.
VanillaMozilla
Posts: 13808
Joined: November 7th, 2005, 11:26 am

Re: access permission of firefox profile on linux OS

Post by VanillaMozilla »

Bingo! Frenzie's got it. sudo is not supposed to be used with a GUI program.
Post Reply