1

My local computer has Debian 10 and I'm using Dolphin on KDE. I am using it to connect to a remote computer running ubuntu 16.04. I am able to connect and browse through the files using the sftp command in Dolphin:

sftp://{username[:password]}@{domain}/{path}

My user on the remote computer is a sudoer. From my local computer, I can open the file on the remote computer I want to edit, but when I try to save it I get "Access is denied". The remote file's permissions are set to 674, and my user account on the remote computer is in the group that the file's group is in. I'm not sure why access is being denied. Shouldn't anyone in the group have write access?

3
  • What are the permissions on the remote directory containing the file? Do you have write access to the directory?
    – Kenster
    Commented Feb 11, 2021 at 20:24
  • The folder the file is in is also in the same group.
    – raphael75
    Commented Feb 11, 2021 at 20:26
  • Ahhh, it looks like the mode on the folder was 755. I changed it to 775 and it looks like I can now edit it!
    – raphael75
    Commented Feb 12, 2021 at 13:13

1 Answer 1

1

On UNIX/Linux a directory is just a "list" of filenames and inodes. If you already got write permission to an existing file, you should be able to modify it. But to create/delete a file in a directory, one must have write permission to the directory itself.

sudo seems irrelevant here, although one could call remote /usr/lib/ssh/sftp-server via sudo - eg. sftp -s '/usr/bin/sudo /usr/libexec/sftp-server' <remotehost>.

From the 3rd comment I suppose the editor was using FUSE via sftp and was creating a temporary file while editing the original one, and as the author didn't have write permission for the directory it failed.

You must log in to answer this question.

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