LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 01-22-2008, 12:46 AM   #1
babu198649
Member
 
Registered: Oct 2007
Posts: 160

Rep: Reputation: 30
how 2 execute programs in remote computer through sftp


hi

i have to execute eclipse which is on the remote computer .is it possible through sftp.
 
Old 01-22-2008, 01:00 AM   #2
zeeshanhayat
Member
 
Registered: Oct 2004
Distribution: Fedora, Debian, Free BSD
Posts: 71

Rep: Reputation: 15
you can execute commands using ssh.
 
Old 01-22-2008, 01:07 AM   #3
babu198649
Member
 
Registered: Oct 2007
Posts: 160

Original Poster
Rep: Reputation: 30
thanks for reply
the commands of sftp which is listed when help command is executed does not show the commmand which will execute remote program.

can u tell me the command which will execute the program which is on remote computer.
 
Old 01-22-2008, 01:11 AM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677
Use ssh instead of sftp to access a shell on the remote computer.
If you are going to launch a graphical program, then access the remote computer with the command: "ssh -X username@hostname" where "username" is your username on the remote computer, not on the local computer.
 
Old 01-22-2008, 01:20 AM   #5
zeeshanhayat
Member
 
Registered: Oct 2004
Distribution: Fedora, Debian, Free BSD
Posts: 71

Rep: Reputation: 15
Quote:
Originally Posted by babu198649 View Post
thanks for reply
the commands of sftp which is listed when help command is executed does not show the commmand which will execute remote program.

can u tell me the command which will execute the program which is on remote computer.

As i wrote earlier, use SSH instead of SFTP.. If you are on a linux machine..

Open a terminal and issue the command

ssh user@host

If you are on a windows machine, use putty
 
Old 01-22-2008, 01:26 AM   #6
babu198649
Member
 
Registered: Oct 2007
Posts: 160

Original Poster
Rep: Reputation: 30
thank u very much jschiwal
i cant beleive it .i can use the remote computer as if it were local system.and when i run eclipse of remote computer the files of the remote computer are accesed rightly.

is there any program through which i can use these facilites in a interactive mode rather than command prompt.
 
Old 01-22-2008, 01:36 AM   #7
zeeshanhayat
Member
 
Registered: Oct 2004
Distribution: Fedora, Debian, Free BSD
Posts: 71

Rep: Reputation: 15
Quote:
Originally Posted by babu198649 View Post
thank u very much jschiwal
i cant beleive it .i can use the remote computer as if it were local system.and when i run eclipse of remote computer the files of the remote computer are accesed rightly.

is there any program through which i can use these facilites in a interactive mode rather than command prompt.

Depends which OS are you using on the client machine..
 
Old 01-22-2008, 01:45 AM   #8
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677
You can configure the remote computers session manager such as kdm or gdm to allow this but it would entail reducing security to offer the entire desktop. The easiest way would be if your distro has a wizard for doing this, because it could involve xorg.conf edits, PAM configuration changes, gdm or kdm configuration changes and maybe /etc/security/access.conf. I would recommend starting GUI programs in the shell. If your remote computer is a windows machine, I'd recommend installing cygwin/X. This will give you a free X windows server on your windows machine.
 
Old 01-22-2008, 01:50 AM   #9
ravibhure
Member
 
Registered: May 2007
Posts: 75

Rep: Reputation: 15
Hi Babu,
You used ssh command to execute eclipse - example -
# ssh root@<remote-ip-add> `/bin/sh <execute program>`

For execute your program give the password.
 
Old 01-22-2008, 03:10 AM   #10
babu198649
Member
 
Registered: Oct 2007
Posts: 160

Original Poster
Rep: Reputation: 30
thank u ravibhure

when i execute the command i got this.

user@localhost:~/eclipse$ ssh root@192.168.1.5`/bin/sh`
sh-3.2$


i gave command ls and it did nothing.
is it a shell.
 
Old 01-23-2008, 01:33 AM   #11
ravibhure
Member
 
Registered: May 2007
Posts: 75

Rep: Reputation: 15
Hi Babu
given command using like below

user@localhost:~/eclipse$ ssh root@192.168.1.5 '<command for execution'

(in single quote give your command for execution for eclipse)

when you give this command one remote machine it ask for root password for remote machine(192.168.1.5).

Do not copy paste above command just type it manually.
 
Old 01-24-2008, 12:55 AM   #12
geek745
Member
 
Registered: Jul 2004
Location: Boston, MA
Distribution: Slackware; Ubuntu; Slax
Posts: 172
Blog Entries: 2

Rep: Reputation: 34
You need to use X11 forwarding over ssh to see the eclipse window. I haven't actually gotten to use anything useful this way; neither have I been persistent in figuring it out. The idea is that you have a local X session with a terminal open, then you ssh into the other box with X11 forwarding enabled (command-line option and the config file on the remote side must allow it) then you can run a command that results in a graphical application loading, and it should be painted on the local machine for you to use.

Note that this requires a lot of bandwidth. Also note that there are X implementations that run on Windows, and you can use these to connect to your Linux box... don't have a good recommendation right now - some you have to pay for...

Somebody correct me if I'm wrong. I almost want to try it again sometime.
 
Old 01-24-2008, 04:24 AM   #13
babu198649
Member
 
Registered: Oct 2007
Posts: 160

Original Poster
Rep: Reputation: 30
hi ravibhure
if i include -X option in u r command then every thing works fine . without the -X option the error is as follows.


[bala@localhost ~]$ ssh root@192.168.1.2 '/home/user/eclipse/eclipse'
root@192.168.1.2's password:

(eclipse:3625): GLib-GObject-WARNING **: invalid (NULL) pointer instance

(eclipse:3625): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed

(eclipse:3625): Gtk-CRITICAL **: gtk_settings_get_for_screen: assertion `GDK_IS_SCREEN (screen)' failed

(eclipse:3625): Gtk-WARNING **: Screen for GtkWindow not set; you must always set
a screen for a GtkWindow before using the window

(eclipse:3625): Gtk-WARNING **: Screen for GtkWindow not set; you must always set
a screen for a GtkWindow before using the window

(eclipse:3625): Gdk-CRITICAL **: gdk_screen_get_display: assertion `GDK_IS_SCREEN (screen)' failed

(eclipse:3625): Gdk-CRITICAL **: gdk_display_get_pointer: assertion `GDK_IS_DISPLAY (display)' failed

(eclipse:3625): Gtk-WARNING **: Screen for GtkWindow not set; you must always set
a screen for a GtkWindow before using the window

(eclipse:3625): Gdk-CRITICAL **: gdk_screen_get_n_monitors: assertion `GDK_IS_SCREEN (screen)' failed

(eclipse:3625): Gtk-WARNING **: Screen for GtkWindow not set; you must always set
a screen for a GtkWindow before using the window

(eclipse:3625): Gdk-CRITICAL **: gdk_screen_get_monitor_geometry: assertion `GDK_IS_SCREEN (screen)' failed

(eclipse:3625): Gdk-CRITICAL **: gdk_screen_get_default_colormap: assertion `GDK_IS_SCREEN (screen)' failed

(eclipse:3625): Gdk-CRITICAL **: gdk_colormap_get_visual: assertion `GDK_IS_COLORMAP (colormap)' failed

(eclipse:3625): Gdk-CRITICAL **: gdk_screen_get_default_colormap: assertion `GDK_IS_SCREEN (screen)' failed

(eclipse:3625): Gdk-CRITICAL **: gdk_screen_get_root_window: assertion `GDK_IS_SCREEN (screen)' failed

(eclipse:3625): Gdk-CRITICAL **: gdk_screen_get_root_window: assertion `GDK_IS_SCREEN (screen)' failed

(eclipse:3625): Gdk-CRITICAL **: gdk_window_new: assertion `GDK_IS_WINDOW (parent)' failed

(eclipse:3625): Gdk-CRITICAL **: gdk_window_enable_synchronized_configure: assertion `GDK_IS_WINDOW (window)' failed

(eclipse:3625): Gdk-CRITICAL **: gdk_window_set_user_data: assertion `window != NULL' failed

(eclipse:3625): Gtk-CRITICAL **: gtk_style_attach: assertion `window != NULL' failed

(eclipse:3625): Gtk-CRITICAL **: gtk_style_set_background: assertion `GTK_IS_STYLE (style)' failed

(eclipse:3625): Gtk-CRITICAL **: gtk_paint_flat_box: assertion `GTK_IS_STYLE (style)' failed

(eclipse:3625): Gdk-CRITICAL **: gdk_window_set_decorations: assertion `GDK_IS_WINDOW (window)' failed

(eclipse:3625): Gdk-CRITICAL **: gdk_window_set_type_hint: assertion `GDK_IS_WINDOW (window)' failed

(eclipse:3625): Gdk-CRITICAL **: gdk_window_set_accept_focus: assertion `GDK_IS_WINDOW (window)' failed

(eclipse:3625): Gdk-CRITICAL **: gdk_window_set_focus_on_map: assertion `GDK_IS_WINDOW (window)' failed

(eclipse:3625): Gdk-CRITICAL **: gdk_window_set_modal_hint: assertion `GDK_IS_WINDOW (window)' failed

(eclipse:3625): Gtk-CRITICAL **: gtk_window_realize_icon: assertion `widget->window != NULL' failed

(eclipse:3625): Gtk-WARNING **: Screen for GtkWindow not set; you must always set
a screen for a GtkWindow before using the window

(eclipse:3625): Gtk-WARNING **: Screen for GtkWindow not set; you must always set
a screen for a GtkWindow before using the window

(eclipse:3625): Gdk-CRITICAL **: gdk_screen_get_display: assertion `GDK_IS_SCREEN (screen)' failed

(eclipse:3625): Gdk-CRITICAL **: gdk_display_get_pointer: assertion `GDK_IS_DISPLAY (display)' failed

(eclipse:3625): Gtk-WARNING **: Screen for GtkWindow not set; you must always set
a screen for a GtkWindow before using the window

(eclipse:3625): Gdk-CRITICAL **: gdk_screen_get_n_monitors: assertion `GDK_IS_SCREEN (screen)' failed

(eclipse:3625): Gtk-WARNING **: Screen for GtkWindow not set; you must always set
a screen for a GtkWindow before using the window

(eclipse:3625): Gdk-CRITICAL **: gdk_screen_get_monitor_geometry: assertion `GDK_IS_SCREEN (screen)' failed

(eclipse:3625): Gdk-CRITICAL **: gdk_window_set_geometry_hints: assertion `GDK_IS_WINDOW (window)' failed

(eclipse:3625): Gdk-CRITICAL **: gdk_window_move: assertion `GDK_IS_WINDOW (window)' failed

(eclipse:3625): GLib-GObject-CRITICAL **: g_object_ref: assertion `G_IS_OBJECT (object)' failed

(eclipse:3625): Gtk-CRITICAL **: gtk_style_attach: assertion `window != NULL' failed

(eclipse:3625): GLib-GObject-CRITICAL **: g_object_ref: assertion `G_IS_OBJECT (object)' failed

(eclipse:3625): Gtk-CRITICAL **: gtk_style_attach: assertion `window != NULL' failed

(eclipse:3625): Gdk-CRITICAL **: gdk_screen_get_default_colormap: assertion `GDK_IS_SCREEN (screen)' failed

(eclipse:3625): Gdk-CRITICAL **: gdk_colormap_get_visual: assertion `GDK_IS_COLORMAP (colormap)' failed

(eclipse:3625): Gdk-CRITICAL **: gdk_screen_get_default_colormap: assertion `GDK_IS_SCREEN (screen)' failed

(eclipse:3625): Gdk-CRITICAL **: gdk_screen_get_root_window: assertion `GDK_IS_SCREEN (screen)' failed

(eclipse:3625): Gdk-CRITICAL **: gdk_window_new: assertion `GDK_IS_WINDOW (parent)' failed

(eclipse:3625): Gdk-CRITICAL **: gdk_window_set_user_data: assertion `window != NULL' failed

(eclipse:3625): Gtk-CRITICAL **: gtk_style_attach: assertion `window != NULL' failed

(eclipse:3625): Gtk-CRITICAL **: gtk_style_set_background: assertion `GTK_IS_STYLE (style)' failed

(eclipse:3625): GLib-GObject-CRITICAL **: g_object_ref: assertion `G_IS_OBJECT (object)' failed

(eclipse:3625): Gtk-CRITICAL **: gtk_style_attach: assertion `window != NULL' failed

(eclipse:3625): Gdk-CRITICAL **: gdk_window_invalidate_rect: assertion `window != NULL' failed

(eclipse:3625): Gdk-CRITICAL **: gdk_window_show: assertion `GDK_IS_WINDOW (window)' failed

(eclipse:3625): Gdk-CRITICAL **: gdk_window_invalidate_rect: assertion `window != NULL' failed

(eclipse:3625): Gdk-CRITICAL **: gdk_window_invalidate_rect: assertion `window != NULL' failed

(eclipse:3625): Gdk-CRITICAL **: gdk_window_unmaximize: assertion `GDK_IS_WINDOW (window)' failed

(eclipse:3625): Gdk-CRITICAL **: gdk_window_unstick: assertion `GDK_IS_WINDOW (window)' failed

(eclipse:3625): Gdk-CRITICAL **: gdk_window_deiconify: assertion `GDK_IS_WINDOW (window)' failed

(eclipse:3625): Gdk-CRITICAL **: gdk_window_unfullscreen: assertion `GDK_IS_WINDOW (window)' failed

(eclipse:3625): Gdk-CRITICAL **: gdk_window_set_keep_above: assertion `GDK_IS_WINDOW (window)' failed

(eclipse:3625): Gdk-CRITICAL **: gdk_window_set_keep_below: assertion `GDK_IS_WINDOW (window)' failed

(eclipse:3625): Gdk-CRITICAL **: gdk_window_show: assertion `GDK_IS_WINDOW (window)' failed

(eclipse:3625): Gtk-WARNING **: Screen for GtkWindow not set; you must always set
a screen for a GtkWindow before using the window

(eclipse:3625): Gdk-CRITICAL **: gdk_window_withdraw: assertion `GDK_IS_WINDOW (window)' failed

(eclipse:3625): Gdk-CRITICAL **: gdk_window_get_state: assertion `GDK_IS_WINDOW (window)' failed

(eclipse:3625): Gdk-CRITICAL **: gdk_window_hide: assertion `GDK_IS_WINDOW (window)' failed

(eclipse:3625): Gtk-CRITICAL **: gtk_style_detach: assertion `GTK_IS_STYLE (style)' failed

(eclipse:3625): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed

(eclipse:3625): Gtk-CRITICAL **: gtk_style_detach: assertion `GTK_IS_STYLE (style)' failed

(eclipse:3625): Gdk-CRITICAL **: gdk_window_set_user_data: assertion `window != NULL' failed

(eclipse:3625): Gdk-CRITICAL **: _gdk_window_destroy_hierarchy: assertion `window != NULL' failed

(eclipse:3625): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed

(eclipse:3625): Gtk-CRITICAL **: gtk_style_detach: assertion `GTK_IS_STYLE (style)' failed

(eclipse:3625): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed

(eclipse:3625): Gtk-CRITICAL **: gtk_style_detach: assertion `GTK_IS_STYLE (style)' failed

(eclipse:3625): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed

(eclipse:3625): Gtk-CRITICAL **: gtk_style_detach: assertion `GTK_IS_STYLE (style)' failed

(eclipse:3625): Gdk-CRITICAL **: gdk_window_set_user_data: assertion `window != NULL' failed

(eclipse:3625): Gdk-CRITICAL **: _gdk_window_destroy_hierarchy: assertion `window != NULL' failed

(eclipse:3625): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed

(eclipse:3625): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed

(eclipse:3625): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed

(eclipse:3625): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed

(eclipse:3625): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed

(eclipse:3625): GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed

(eclipse:3625): GLib-GObject-WARNING **: invalid (NULL) pointer instance

(eclipse:3625): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion `G_TYPE_CHECK_INSTANCE (instance)' failed

(eclipse:3625): Gtk-CRITICAL **: gtk_settings_get_for_screen: assertion `GDK_IS_SCREEN (screen)' failed

(eclipse:3625): GLib-GObject-CRITICAL **: g_object_get: assertion `G_IS_OBJECT (object)' failed

(eclipse:3625): GLib-GObject-WARNING **: value "TRUE" of type `gboolean' is invalid or out of range for property `visible' of type `gboolean'

(eclipse:3625): Gtk-WARNING **: Screen for GtkWindow not set; you must always set
a screen for a GtkWindow before using the window

(eclipse:3625): Gdk-CRITICAL **: gdk_pango_context_get_for_screen: assertion `GDK_IS_SCREEN (screen)' failed

(eclipse:3625): Pango-CRITICAL **: pango_context_set_font_description: assertion `context != NULL' failed

(eclipse:3625): Pango-CRITICAL **: pango_context_set_base_dir: assertion `context != NULL' failed

(eclipse:3625): Pango-CRITICAL **: pango_context_set_language: assertion `context != NULL' failed

(eclipse:3625): Pango-CRITICAL **: pango_layout_new: assertion `context != NULL' failed

(eclipse:3625): Pango-CRITICAL **: pango_layout_set_text: assertion `layout != NULL' failed

(eclipse:3625): Pango-CRITICAL **: pango_layout_set_attributes: assertion `layout != NULL' failed

(eclipse:3625): Pango-CRITICAL **: pango_layout_set_alignment: assertion `layout != NULL' failed

(eclipse:3625): Pango-CRITICAL **: pango_layout_set_ellipsize: assertion `PANGO_IS_LAYOUT (layout)' failed

(eclipse:3625): Pango-CRITICAL **: pango_layout_set_single_paragraph_mode: assertion `PANGO_IS_LAYOUT (layout)' failed

(eclipse:3625): Pango-CRITICAL **: pango_layout_set_width: assertion `layout != NULL' failed

(eclipse:3625): Pango-CRITICAL **: pango_layout_get_extents: assertion `layout != NULL' failed
#
# An unexpected error has been detected by Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x48ee79ff, pid=3625, tid=4160579264
#
# Java VM: Java HotSpot(TM) Client VM (11.0-b07 mixed mode, sharing linux-x86)
# Problematic frame:
# C [libgtk-x11-2.0.so.0+0xf99ff] gtk_icon_set_render_icon+0x55f
#
# An error report file with more information is saved as:
# /root/hs_err_pid3625.log

(eclipse:3625): Gtk-CRITICAL **: gtk_icon_theme_get_for_screen: assertion `GDK_IS_SCREEN (screen)' failed

(eclipse:3625): Gtk-CRITICAL **: gtk_settings_get_for_screen: assertion `GDK_IS_SCREEN (screen)' failed

(eclipse:3625): Gtk-CRITICAL **: gtk_icon_size_lookup_for_settings: assertion `GTK_IS_SETTINGS (settings)' failed

(eclipse:3625): Gtk-WARNING **: Invalid icon size 6


(eclipse:3625): Gtk-CRITICAL **: gtk_icon_theme_load_icon: assertion `GTK_IS_ICON_THEME (icon_theme)' failed
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
[bala@localhost ~]$
 
Old 01-25-2008, 06:39 AM   #14
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677
Use "ssh -X user@host". Then type in the eclipse command to run it. You can include the command to run in the same command. The -X option is needed to forward X windows traffic through the ssh tunnel. Also the /etc/ssh/sshd_config file on the computer you are connecting to needs to allow X forwarding.

If you wanted to you could even create a shortcut on the desktop (launcher) and enter the ssh command there. Then in the future you can simply double click on the icon and enter the password.

For example: "ssh -X hpmedia /opt/kde3/bin/konqueror" will prompt for the password and then launch konqueror on the hpmedia desktop, but display on my laptop.

By the way, log in as a regular user. Don't enable root logins, and don't run an ide as root.

Last edited by jschiwal; 01-25-2008 at 06:48 AM.
 
Old 01-28-2008, 12:10 AM   #15
ravibhure
Member
 
Registered: May 2007
Posts: 75

Rep: Reputation: 15
Hi Babu,
Yes, It's correct for eclipse or any apps that require java run time you have to just enable remote machines X-Forwarding or use -X in ssh option.
Thanks for correcting my suggestion.
 
  


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
Nautilus cannot display Remote SFTP Location. saspijkerman Linux - Networking 1 09-16-2010 11:47 PM
Passwordless sftp to many remote hosts ahmad_abdulghany Linux - Networking 7 04-04-2007 07:18 PM
setting up remote or sftp access helpme0904 Linux - Newbie 2 08-02-2005 04:12 PM
VSFTP - SFTP error: Couldn't get remote handle. m0untaind0g Linux - Networking 3 01-20-2004 01:24 PM
run programs on a remote computer with script, how? cmisip Linux - Networking 5 07-07-2003 02:48 PM

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

All times are GMT -5. The time now is 09:52 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration