LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-02-2009, 08:05 AM   #1
kenneho
Member
 
Registered: May 2003
Location: Oslo, Norway
Distribution: Ubuntu, Red Hat Enterprise Linux
Posts: 657

Rep: Reputation: 40
"sudo su - someuser -c xterm" doesn't work


Hi.


I have a user A that need to log into a linux box, change to user B, and then fire up a GUI.

I've tried this:

Code:
[userA@server ~]$ sudo su - userB -c "xterm" 
X connection to localhost:10.0 broken (explicit kill or server shutdown).
Running "echo $DISPLAY" shows the same value for user A as for user B when I first run "sudo su - userB".

I thought that if the $DISPLAY variable is set correctly this would work, but apparently it doesn't. Does anyone else here know how to get this working?

kenneho

EDIT: I forgot to mention that I'm SSH-ing into the server, and have x-forwading enabled.

Last edited by kenneho; 10-02-2009 at 08:06 AM.
 
Old 10-02-2009, 08:08 AM   #2
cpuobsessed
Member
 
Registered: Jan 2006
Distribution: Fedora, Ubuntu, Slackware
Posts: 56

Rep: Reputation: 15
Do it one step at time, first switch users then execute the command.
 
  


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
sudo fails - "sudo: can't get hostname: Success" fantasygoat Linux - Server 3 10-01-2009 02:59 PM
cannot "sudo apt-get uptate" or "sudo" anything! plz help mdguy21061 Linux - Newbie 7 04-13-2008 11:59 PM
Any way to get "Alice"; "Call of Duty" series and "Descent 3" to work? JBailey742 Linux - Games 13 06-23-2006 01:34 PM
how do I get around the "submit passwd" prompt in ubuntu even if I use "sudo"? t3gah Linux - Distributions 1 02-22-2005 04:42 PM
normal user want to perform "init 6" by using " sudo acbenny Linux - General 3 08-08-2004 07:41 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:42 AM.

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