Results 1 to 4 of 4

Thread: Gedit sftp remote server connection - sudo issue

  1. #1
    Join Date
    Dec 2013
    Location
    UK
    Beans
    107
    Distro
    Ubuntu 14.04 Trusty Tahr

    Gedit sftp remote server connection - sudo issue

    Hi,

    I've just had some lovely success accessing my server from my workplace using an Ubuntu 12.10 laptop (gnome) - Under Places, I clicked Connect to server... set up my server's details and connected. Wonderful! I can now easily in a GUI access all of my home files.

    As a test, I opened up an image (from my NAS, mounted to my server), edited it with GIMP, saved it as a new file (on the mounted NAS location)... Great!

    So, on to test 2.... I want to use Gedit to edit html files on my server.

    I simply opened up gedit from the gnome menu, browsed to my server, opened up one of my html files from (var/www/html)... Great... But now comes the trouble...

    Upon trying to save changes to the file, or indeed save it as a new file name to var/www/html, Gedit can't because of permissions, fair enough, i'm not sudo. I can save it to my mounted NAS location though as not sudo.

    So, I thought I'd run Gedit as sudo. When I go to File, Open, I don't see my network locations, in fact, the file browser is much restricted compared to a non-sudo instance of gedit.

    Trying Workarounds...

    I then dragged and dropped an html file from a nautilus window onto my sudo'd gedit window, only for it to fail, declaring that: "gedit cannot handle sftp: locations." which is daft, as it can when not opened as sudo.

    How can I make this sudo instance of gedit work with sftp locations, as it clearly can when not sudo?

    Cheers, Scott.

  2. #2
    Join Date
    Apr 2012
    Beans
    7,256

    Re: Gedit sftp remote server connection - sudo issue

    When you use "Nautilus --> Connect to server..." it mounts the remote filesystem as a Gnome Virtual Filesystem (gvfs) mount that is owned by you and has very restrictive permissions (root can't even read the mounted files)

  3. #3
    Join Date
    Sep 2006
    Beans
    8,627
    Distro
    Ubuntu 14.04 Trusty Tahr

    DIrectory permissions

    Quote Originally Posted by scott.bouch View Post
    I simply opened up gedit from the gnome menu, browsed to my server, opened up one of my html files from (var/www/html)... Great... But now comes the trouble...
    It would probably be easier to fix your directory permissions. If you are the only user on that system, you can just take ownership of the directories and then you can run gedit as a normal user.

    Code:
    sudo chown -R scott:scott /var/www/html
    In that way you can avoid running a graphical program as root, which is generally undesirable.

    If you are sharing the directory and files with others then something similar can be done using groups instead.

  4. #4
    Join Date
    Dec 2013
    Location
    UK
    Beans
    107
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Gedit sftp remote server connection - sudo issue

    Lars - good work!

    As I'm the only user, I gave myself permissions over the directory as you said, and it's fixed it!

    Now I can edit my website www.scottbouch.com remotely using the lovely gedit instead of Nano over SSH!

    Thanks for the help chaps! Scott.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •