Linux Bleg

So I’ve been living with Fedora for over six weeks now, since my Windows 2000 machine died from a bad patch. One of the things that was good about Windows was that WinSCP allows one to securely edit a remote file without manually downloading and reuploading. It has an editor actually built in for this purpose, and when you do a save, it saves it to the remote directory.

Is there any software with a similar capability in Linux? I can use Nautilus to browse remote files, and I can even launch them with a local text editor (gedit), but it doesn’t seem to allow me to save for some reason. Or do I have to go back to an ssh session and vi or emacs to do remote editing?

[Update]

Thanks to smart commenters, problem solved, in a way beyond my wildest dreams. My web server is now functionally a (relatively slow) local file system, liberating me forever from ssh and scp (since that was the only remote server that I deal with regularly). Life in the 21st century…

16 thoughts on “Linux Bleg”

  1. What do you mean by “remote”? What is the other side- another Linux/Unix machine? Is it on the same LAN, or are you talking about over the internet?

  2. Use sshfs. I presume there is an RPM available with Fedora, but I haven’t used anything except Gentoo in years, so I don’t know for sure.

    http://fuse.sourceforge.net/sshfs.html

    Anyway, you can mount a remote site into a local directory, and then edit the files in the directory as if it were local.

    For optimum use (automatic reconnects etc), upload your public key to the server and stick it in authorized_keys, and run a local ssh-agent.

    There are several howtos online for this. Feel free to email me if you have any questions.

  3. But then I’d have to run a command line for each file I want to edit. I want to do it all from the GUI. I want to be able to browse a directory, double-click a text file, have it open gedit, and save when I save. The remote mount sounds like the best solution so far.

  4. In principle you can ask SSH to forward your X connections. Then you ssh in and fire up whatever GUI tools you want on the remote host, they display locally. But X connections are bandwidth-intensive, I’ve rarely been satisfied with the performance over the Internet.

    Also look into VNC maybe, which allows you to fire up an entire desktop on the remote machine and have it display locally. Not sure if this works well over the Internet, again.

    Me, I would just ssh in and use vi. If I have to do some repetitive task, it’s Perl-script time.

  5. Me, I would just ssh in and use vi.

    That’s what I’ve been doing for years, but WinSCP spoiled me.

    BTW, I installed sshfs, but I get a “missing host” error when I execute the following:

    sshfs myaccount@myserver.com /mnt/Webserver -o port=portnumber

    Anyone know what I’m doing wrong?

  6. On paper, Ray’s idea is clearly the best. We ship FUSE, so there’s no need to install anything.

    Myself, I would probably just use remote X (tunneled through ssh with “ssh -Y remote”, of course), and gvim or gedit. I do not trust FUSE not to crash my local desktop, which is probably worse than the remote (depending what restart and console facilities remote has, how critical its uptime is for the business, etc.).

  7. Yup, that was it. I didn’t realize I needed the colon if I wasn’t specifying a non-home directory.

    And it worked. My webserver is now a local directory on my fileserver. That is slicker than snail snot.

    Thanks, folks. It also means that I can access it from other machines on the network without ssh/scp, right?

  8. Glad it worked. You may have issues with timeouts on your server. If you end up with your directory getting spontaneously disconnected, I’ve been there, and know which chickens to sacrifice.

  9. You may have issues with timeouts on your server.

    It’s pretty good about that. I can keep an ssh connection up for days. It is my server (dedicated), though I let others administer it. If it’s an issue, I’ll work it out with them. But if I have problems, I’ll keep it in mind, thanks.

    I guess I should also put the sshfs command into my boot procedure, not that I boot that often (it’s my home network fileserver, in addition to having become my work station)…

  10. It also means that I can access it from other machines on the network without ssh/scp, right?

    Not without sharing it, though. I guess I need to update Samba. Maybe for security reasons, I should just keep it the way it is, since I’m also wireless.

  11. Another widget you may want to consider is rsync. Very handy for keeping updated copies of files — or an entire filesystem — on another machine. It transfers only the differences between files, so you can keep a monster filesystem duplicated with very small transfers.

Comments are closed.