Results 1 to 4 of 4

Thread: SFTP, GEdit, file permissions and owner changed!

  1. #1
    Junior Member
    Join Date
    Aug 2011
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Default SFTP, GEdit, file permissions and owner changed!

    Hi,

    I'm using Ubuntu 11.04 to access a server via SFTP in Nautilus. If I open a PHP file and then save it, the permissions and owner are modified!

    For example, if I have /var/www/index.php on my server (192.168.1.2) and I do the following:

    1. Open Nautilus.
    2. Press CTRL + L.
    3. In the address bar enter: sftp://192.168.1.2/var/www/
    4. Double click on index.php to open it with GEdit.
    5. Make some changes to index.php.
    6. Save index.php.

    the result is the permissions for index.php are modified, and the owner is changed from www-data to my username.

    Is there any way to preserve the original owner of the file and file permissions?

    Thanks in advance.

  2. #2
    Never say die nixcraft's Avatar
    Join Date
    Jan 2005
    Location
    BIOS
    Posts
    4,515
    Thanks
    17
    Thanked 814 Times in 511 Posts
    Rep Power
    10

    Default

    You are saving files locally, aren't you? You need to share 192.168.1.2 via nfs and mount it locally. Once done you can directly edit required files and save them.
    All [Solved] threads are closed by mods / admin to avoid spam issues. See Howto mark a thread as [Solved]


  3. #3
    Junior Member
    Join Date
    Aug 2011
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Default

    Quote Originally Posted by nixcraft View Post
    You are saving files locally, aren't you? You need to share 192.168.1.2 via nfs and mount it locally. Once done you can directly edit required files and save them.
    Sorry for the late reply. Using a mount isn't what I'm after. I want to be able to preserve the permissions (more precisely, just the group permissions) if I open a file in Nautilus and edit/save it. For example:

    A file exists on some.server.net: /var/www/index.php.
    The owner:group for index.php is john:www-data, and the permissions are 774.

    1. Open Nautilus.
    2. Press CTRL + L.
    3. In the address bar, enter: sftp://some.server.net/var/www
    4. Enter credentials for 'john'.
    5. Double click on the file (index.php) to open it.
    6. Make some changes to the file.
    7. Save the file.

    The result of the above is the group and the permissions of index.php will be altered. What I want (and expect) is for the owner and permissions to remain the same.

    Is there any way to do this?

  4. #4
    Junior Member
    Join Date
    Jan 2012
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Default

    Have you tried to modify the file with FileZilla or some other client, that supports SFTP? Also, could you execute the following commands and give us the results:

    1) cd /var/www/ ; ls -alh | grep index.php

    2) start index.php

    Also, try to chmod the index.php file to 0644, and check if there is going to be a change after that.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. User not able to write on a file with 770 permissions
    By abhinav4 in forum CentOS / RHEL / Fedora
    Replies: 2
    Last Post: 5th April 2010, 04:06 PM
  2. copy only changed files
    By houndhen in forum Ubuntu / Debian
    Replies: 2
    Last Post: 10th March 2010, 05:51 PM
  3. stuck in file permissions
    By Raj K Yadav in forum Linux software
    Replies: 0
    Last Post: 9th November 2008, 01:33 AM
  4. Replies: 1
    Last Post: 25th August 2008, 02:39 PM
  5. Replies: 2
    Last Post: 20th December 2006, 01:57 AM

Tags for this Thread

Posting Permissions

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