LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 01-15-2007, 07:07 AM   #1
GuruPrasad
LQ Newbie
 
Registered: Feb 2006
Distribution: Mandriva 2007
Posts: 9

Rep: Reputation: 0
How do I run Firefox as a different user?


Hello everyone,
In my previous installations of Mandriva 10.2 and Mandriva 2006, I was able to run Firefox, and a lot of other programs, as a different user (without the current user logging off) by doing

Code:
su <user name>
in the console (in KDE), and simply typing "firefox". The other user's bookmarks,history and preferences would promptly show up in the new Firefox window. However, in my recent Mandriva 2007 installation, when I try to do the same thing, I get


Code:
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified


(mozilla-firefox-bin:17976): Gtk-WARNING **: cannot open display:
I would really like to be able to run Firefox and other programs as a different user How do I do that? Maybe through sudo, perhaps?
Thanks in advance,
Guru
 
Old 01-15-2007, 07:11 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
run "xhost +localhost" to allow other users to connect to the local X server.
 
Old 01-15-2007, 07:39 AM   #3
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
Or if you only want user2 to access X server which has been started by user1, do this:

*
under <user1>:
$xauth list
Code:

<hostname>/unix:0 MIT-MAGIC-COOKIE-1 03f3300ed7caa12e87ebcc0c2d51516c <-- take this security cookie


*
under <user2>:
Code:

$xauth add <hostname>/unix:0 MIT-MAGIC-COOKIE-1 03f3300ed7caa12e87ebcc0c2d51516c <-- copy it to user2

Now you should be able to start any X applications with user2, connecting to X server started by user1


Other methods require sudo or sux
 
Old 01-15-2007, 08:38 AM   #4
GuruPrasad
LQ Newbie
 
Registered: Feb 2006
Distribution: Mandriva 2007
Posts: 9

Original Poster
Rep: Reputation: 0
I tried the xhost +localhost, and it works!
Will try out the cookie trick at work.
Thanks a million!

Guru
 
  


Reply



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
Ran Firefox as root, now can't run as user! mazinoz Linux - Desktop 1 01-13-2007 03:16 AM
I can't run Firefox from my single user(only from a super user) nightrider Linux - Newbie 14 10-24-2006 08:35 PM
i can run firefox browser only under root user zowey Linux - Software 7 08-27-2006 02:50 PM
firefox dos not open when run under user (opens only in root) saso Mandriva 8 06-15-2005 10:07 AM
am able to run firefox off console as SU, but not as user... Lechium Slackware 9 08-01-2004 04:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 11:25 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
Open Source Consulting | Domain Registration