How to use gedit from putty remote connection on Putty
There are two different ways of achieving this:
- executing a remote gedit using X Forwarding via SSH
- executing a local gedit on a remote file through SSH
Remote gedit
Normally you do that using X Forwarding via SSH. On Windows you will need some kind of X server, for example xming. See http://www.math.umn.edu/systems_guide/putty_xwin32.html for instructions.
There are more tutorials on the web, from brief Googling:
- http://courses.cms.caltech.edu/cs11/misc/xwindows.html
- X11 Forwarding using Putty on Windows (Youtube)
Local gedit
You point your local gedit installed on your machine to the remote file through SSH. See e.g. http://thecodecentral.com/2010/04/02/use-gedit-as-remote-file-editor-via-ftp-and-ssh-ubuntu how to do that on Ubuntu.
On Windows, you might want to mount a remote folder as a local disk: How do I mount a remote Linux folder in Windows through SSH?
Alternatively, it might be possible to use a Gedit plugin: https://code.google.com/p/gedit-remote-editing-file/
Ryman Holmes
Programmer from the University of Toronto, Canada. Web Applications | Mobile Web Design | Web Development
Updated on June 05, 2022Comments
-
Ryman Holmes almost 2 years
I am struggling to use
gedit
through a remote connection usingPutty
from a windows machine, it will really help if someone can find a way to do this.Is there a way we can use
gedit
from a windows machine by usingputty
to remotely connect? -
Ryman Holmes about 10 yearsI followed the instructions of the link you sent, I downloaded and installed X server and configured it however it doesn't still recognise commands like
xeyes &
orgedit
-
Jakub Kotowski about 10 yearsWhat do you mean it does not recognize? Are you getting some errors? It should work if xeyes and gedit are installed, which I suppose they are (you can check by running
which xeyes
). Sometimes there is a problem with authorization. You might need to run e.g.xhost +
on the server where you are trying to run gedit. But notice thatxhost +
grants access to everyone. You might want to restrict it. -
Ryman Holmes about 10 yearsI have
gedit
downloaded but when I try to open say ansh
script file using the commandgedit file.sh
it gives me the errorgedit: command not found
-
Jakub Kotowski about 10 yearsThen gedit is not installed or it is not on your PATH. Install gedit properly first. What OS is it? On Debian and Ubuntu you would do sudo apt-get install gedit. One problem could be that PATH is not initialised because logging in via putty doesn't source .bashrc. Check your 'PATH' and try to source .bashrc by running '. .bashrc'.
-
Ryman Holmes about 10 yearsI have installed gedit however I don't know how to set the PATH... I'm on Windows 7... Putty is not recognising any of the commands you are telling me#
-
Jakub Kotowski about 10 yearsHow exactly did you install gedit? You are on windows 7 but what is the OS of the server where you are logging in? After you log in, run
uname -a
andecho $PATH
and post the outputs here. -
Ryman Holmes about 10 yearsI installed gedit the standard way using windows installer. Not sure what you mean by what is the OS server, I am using xming as the instructions told me to. I am logging on to my University server remotely which is Windows 7. When I run
uname -a
I get this:SunOS gnasher 5.9 Generic_122300-19 sun4u sparc SUNW,UltraAX-i2
When I runecho $PATH
i get this:/usr/bin:/usr/local/bin
-
Jakub Kotowski about 10 yearsThe server is running Solaris 9, not a linux. You might want to check whether there is X11 installed (java.net/projects/solaris-x11/pages/Home). Check what shell you are running
echo $SHELL
, if it is not bash, try running bashbash
and look what scripts are available in the home directory after you loginls -a
and look for.bashrc
or.bash_profile
, have a look whether they set upPATH
or just try to source themsource .bashrc
, and/orsource .bash_profile
. -
Jakub Kotowski about 10 yearsI am confused :) Are you saying the remote system is Windows 7 but you can run
uname -a
and it says SunOS 5.9? That doesn't make any sense. You're using Windows 7 on your own computer and you are logging onto a remote university server which runs Solaris 9 (SunOS 5.9). You have to install gedit on the remote university system running Solaris 9 if you want to use it on that system. -
Jakub Kotowski about 10 yearsWhat happens is: gedit is executed on the remote machine and X11 forwarding takes care of sending the rendered image of gedit to your local xming which renders it for you and allows you to interact with it. It is doable but usually it is a bit slow. IMHO you'd be better off just using a text based editor on the remote machine (like Vi or Emacs or Nano if you want something simple to use).
-
Ryman Holmes about 10 yearsSorry... My mistake I am new to all this.. The university server runs Solaris 9. Gedit is already installed on the University machines however gedit only works if you login to Linux (Ubuntu) on the University machines as when you startup you have an opton of logging on to Linux or Windows... All I want is to open gedit from my home computer once I remotely connect, why is it so difficult
-
Ryman Holmes about 10 yearsIt is Bash that is running by the way (on the University machines)
-
Jakub Kotowski about 10 yearsIn that case it will be probably easier for you (and much nicer to use) to setup something like this: thecodecentral.com/2010/04/02/… Essentially you point your local gedit installed on your Windows to the remote file through SSH. But you have to configure it properly on Windows (the link is for ubuntu).
-
Jakub Kotowski about 10 yearsSee also stackoverflow.com/questions/443732/…
-
Ryman Holmes about 10 yearsYou've lost me... I want to use putty to open gedit not install other programs.
-
Ryman Holmes about 10 yearsI don't understand what the problem is with me opening gedit remotely, I have installed it and everything as the instructions told me to
-
Jakub Kotowski about 10 yearsWell, I misunderstood you originally. There are two ways your original question can be interpreted: 1. How do I run gedit on a remote machine ? 2. How do I use local gedit to edit a remote file through SSH? I thought you're asking the first question and didn't think about it twice, sorry. It turns out you are in fact asking the second question. Solutions to both would achieve what you are ultimately after. Originally I suggested solutions to the first question. Scratch that. You can try the other approach. I hope it's clearer.
-
Ryman Holmes about 10 yearsyes... I want to use local gedit to edit a remote file through SSH, Which approach should I try?
-
Jakub Kotowski about 10 yearsThe second one: you attach a remote filesystem as a local windows disk through SSH. This or something similar is what you need to achieve. I'm saying something similar because sometimes the apps support opening URLs such as ssh://user@host:myRemoteFile.txt in which case you wouldn't need to attach a disk but just to enter such URL. I don't think Gedit supports such URLs directly, but there might be plugins for that: code.google.com/p/gedit-remote-editing-file
-
Jakub Kotowski about 10 years
-
whatwhatwhat about 8 yearsIs this something I could set up so that I could use GUI's remotely from home based on a Debian server at school? My professor warned us that using the school's servers for any funny business will stand out and we will be reprimanded - would this get me in trouble? I want to use Gedit and Gnuplot that the servers at school have.