LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-07-2011, 04:48 AM   #1
gregorian
Member
 
Registered: Apr 2006
Posts: 509

Rep: Reputation: 34
How to open a graphical program from a terminal?


I'm logged in via ssh to a computer that is already running X. I want to start gedit on this display. How do I do this?
 
Old 11-07-2011, 05:10 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984
just run it. assuming you are tunnelling X over SSH, which is a default in most setups then it should "just work". see "man ssh_config" for details on X forwarding.
 
Old 11-07-2011, 11:52 AM   #3
arizonagroovejet
Senior Member
 
Registered: Jun 2005
Location: England
Distribution: openSUSE, Fedora, CentOS
Posts: 1,094

Rep: Reputation: 198Reputation: 198
Code:
$ ssh -X user@host
$ gedit
 
Old 11-07-2011, 08:53 PM   #4
gregorian
Member
 
Registered: Apr 2006
Posts: 509

Original Poster
Rep: Reputation: 34
Quote:
Originally Posted by acid_kewpie View Post
just run it. assuming you are tunnelling X over SSH, which is a default in most setups then it should "just work". see "man ssh_config" for details on X forwarding.
When I just run it I get this:
(gedit:23417): Gtk-WARNING **: cannot open display:

All right, I solved this particular problem. I need to do

export DISPLAY=:0 to run it on my desktop

When I try ssh -X , I get:
X11 connection rejected because of wrong authentication.

http://www.cyberciti.biz/faq/x11-con...uthentication/

I followed the instructions on the above site but they didn't help.

I use public key authentication for ssh so that I don't have to type passwords.

EDIT: ssh -X worked for me to open a X program over the LAN for other machines. Does it not work because I use certificate based authentication?

Giving sudo gedit worked.

Last edited by gregorian; 11-07-2011 at 10:56 PM.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to compile C++ program using Open Terminal Shanki235 Linux - Newbie 3 05-14-2010 11:30 AM
open sudo terminal program in aix in c sachin.s.puri AIX 1 12-21-2009 08:22 AM
Automatically start graphical (SDL) program as root on non-graphical Debian the_merovingian Debian 1 03-03-2009 03:20 PM
Graphical terminal clane Linux - Newbie 5 05-19-2008 01:13 AM
Open a Terminal and run a program after Gnome boot. sirius56 Linux - Newbie 8 01-02-2007 07:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:03 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