LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-10-2011, 09:11 AM   #1
bartonski
Member
 
Registered: Jul 2006
Location: Louisville, KY
Distribution: Fedora 12, Slackware, Debian, Ubuntu Karmic, FreeBSD 7.1
Posts: 443
Blog Entries: 1

Rep: Reputation: 47
Starting firefox under a different user


I've set up a second user for myself on my laptop.

My user on the laptop is 'tiger'

Let's call the second user 'jrdobbs'

I would like to log on to gmail/facebook/etc using the jrdobbs, but I don't want to switch users via X... I just want a second instance of firefox open, which stores all of its login information under /home/jrdobbs.

My naive attempt looked like this:

Code:
su -l -c "firefox" jrdobbs
Here was my thinking:

  • start firefox under 'su jrdobbs' ... firefox should store its files under the current user's $HOME/.mozilla
  • use the -l (login) flag for 'su', so that I know that I'm using jrdobbs' $HOME, rather than inheriting mine.
This gives the following:

Code:
$ su -l -c firefox jrdobbs
Password: 
Error: no display specified
So I changed firefox to "firefox --display $DISPLAY"

This gives the following:

Code:
$ su -l -c "firefox --display $DISPLAY" jrdobbs
Password: 
No protocol specified
No protocol specified
Error: cannot open display: :0.0
Because I double-quoted "firefox --display ... ", $DISPLAY is expanded to :0.0 before the su command is executed... I thought that this was what I wanted, because I want firefox to show up on tiger's display... however :0.0 is interpreted relative to the current user, and jrdobbs doesn't have a display named :0.0.

I also tried the following:

Code:
$ ssh -X jrdobbs@localhost firefox
This works, but I worry about overhead... my laptop gets plenty hot when I start running flash intensive apps, and that's even before I start encrypting packets...
 
Old 03-10-2011, 11:04 AM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,528

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
As tiger in a terminal type:
Code:
xhost 127.0.0.1
sudo -u jrdobbs -H firefox
Kind regards
 
1 members found this post helpful.
Old 03-10-2011, 08:49 PM   #3
bartonski
Member
 
Registered: Jul 2006
Location: Louisville, KY
Distribution: Fedora 12, Slackware, Debian, Ubuntu Karmic, FreeBSD 7.1
Posts: 443
Blog Entries: 1

Original Poster
Rep: Reputation: 47
repo, thanks, I forgot about xhost.

Still no dice:

Code:
$ xhost 127.0.0.1
127.0.0.1 being added to access control list
$ sudo -u jrdobbs -H firefox
[sudo] password for tiger: 
No protocol specified
No protocol specified
Error: cannot open display: :0.0
 
Old 03-11-2011, 01:41 PM   #4
bartonski
Member
 
Registered: Jul 2006
Location: Louisville, KY
Distribution: Fedora 12, Slackware, Debian, Ubuntu Karmic, FreeBSD 7.1
Posts: 443
Blog Entries: 1

Original Poster
Rep: Reputation: 47
Just found this: http://pr0gr4mm3r.com/linux/how-to-s...ser-in-ubuntu/

according to the article, the magic seems to look like this:

Code:
xhost +local:jrdobbs
I'll give it a try when I get home...
 
Old 03-12-2011, 03:27 PM   #5
bartonski
Member
 
Registered: Jul 2006
Location: Louisville, KY
Distribution: Fedora 12, Slackware, Debian, Ubuntu Karmic, FreeBSD 7.1
Posts: 443
Blog Entries: 1

Original Poster
Rep: Reputation: 47
That worked like a champ.
 
Old 12-16-2016, 12:48 AM   #6
thebunnyrules
LQ Newbie
 
Registered: Dec 2016
Posts: 1

Rep: Reputation: Disabled
THANKS!!!!!! YOU GUYS ARE LIFESAVERS!

Just to sum it up for anyone else that's looking for this answer (it wasn't super clear for me when I was reading the thread):

To launch GUI apps as another user, you input the following command only once:

xhost +local:usersname

and then you only need to use use this command:

sudo -u usersname -H APPSname
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Ubuntu Jaunty User with firefox 3.5.2: get old firefox updates to stop? Captain Obvious Linux - Software 2 04-14-2010 03:09 PM
Need help starting firefox M$ISBS Linux - Software 2 11-06-2005 07:22 AM
Starting Firefox 1.0 as user ? CloudyWizzard Debian 2 11-13-2004 11:38 AM
Firefox not starting as a normal user fredgt Linux - Software 9 10-03-2004 11:27 AM
starting firefox nimrod04 Linux - Software 4 02-17-2004 03:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration