0

I tried to start gedit on one of my servers by running: `ssh test@test-server gedit and it runs, but it displays the filesystem of my server and not my local system.

How can I get gedit to show my local filesystem?

3
  • I understand nothing, I you want to open a file in your local filesystem, than start gedit on your local machine. Where is the problem?
    – A.B.
    Jul 17, 2015 at 12:48
  • Well gedit is an example if i want to use a software not on my system and do some work. Jul 17, 2015 at 13:04
  • You want to start a remote application on your server?
    – A.B.
    Jul 17, 2015 at 13:06

1 Answer 1

1

What you want to do there is not possible.

You are probably using an X11 forward and here you need to understand, that the process of Gedit itself starts on the server, and its only a projection of the application that you see (like a video on youtube, with the only difference that this one responds to your actions). For this particular reason it no wonder that you aren't able to see your local files.

There is a workaround, but it also doesn't do exactly what you want to achieve. You could make a reverse tunnel to your local machine, and then use sshfs to bind one of your local folders (or the entire filesystem) on the remote server.

On your local host:

ssh -R 2222:localhost:22 user@remotehost

On the remote host:

sshfs -o port=2222 localhost:/path/on/your/pc /path/to/bind/folder/on/server 

This might be confusing, but what it does is as follows:
You make a reverse ssh tunnel from your local pc to the remote server. After that you connect to your pc from the remote server through that tunnel, to get to your data you want to edit with gedit.

So now we know this works, but I beg you not to use it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .