Open file from remote computer on host computer

You can mount the remote directory with sshfs, after that, the file is accessible in your local directory tree.

Example:

sshfs user@domain:/remote/directory/ /local/directory/

It's all in the man pages.

Or just copy the file over with scp/rsync, edit it, and copy it back.


If you are familiar with vim, you may use it as follows:

vim scp://user@host:port/file_path_and_filename

Make sure not to forget the "/" character before the filepath; otherwise it won't work; for example:

vim scp://[email protected]:2243//home/user/my_file

You can skip the portnumber if is the same of the default on your /etc/ssh/sshd_config file


If you use GNOME or KDE:

  • open file manager
  • press Ctrl+L to focus address bar
  • enter sftp://host/ and press Enter (replace "host" with your target host)

The file system of the remote host will be displayed in file manager now, and you can navigate to your target directory and double-click the file to open it. As far as I know you can now use any local program to open the file (it doesn't have to be a Gnome or KDE application).

You should also be able to set a bookmark to the remote target directory, to quickly get there again later.

If you want to connect as a different user or using a different port, you can use sftp://user@host:port/somedirectory/.

Tags:

Ssh

Remote