Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Kate/Kwrite, SSH, and permissions

  1. #1

    Default Kate/Kwrite, SSH, and permissions

    I have a permissions question that I'm sure has a simple answer but one I can't find. When saving files through SSH using kate or kwrite, the permissions always reset to 644 when I want them to stay at 666/777. When using notepad (not sure what this is, it's just in my right click contex menu under "open with...") the permissions persisted after I saved. Permissions also persist with kate and kwrite on my local machine.

    Is this something I need to configure on the server?

    Using Opensuse 11.2, kde 4.3, kwrite 4.3.1-5.6.3, kate 4.3.1-3.7

    Thanks!

  2. #2
    Join Date
    Jun 2008
    Location
    Oregon, US
    Posts
    109

    Default Re: Kate/Kwrite, SSH, and permissions

    I'm not 100% sure, but it sounds to me that you want to change the umask value. You can read about this with
    Code:
    man umask
    I think what you want is to add the following line to your .bashrc file
    Code:
    umask 000
    The default is 022, which would give permissions for a new file created by ssh to be 644 (666 - 022). I don't think umask has an effect on files that have already had their permissions modified. Only new files.

    HTH

  3. #3

    Default Re: Kate/Kwrite, SSH, and permissions

    Ok I put "umask 000" in my .bashrc (remote .bashrc right?) and tried creating a new file and saving old files through kate. Both times the file got 644 permissions.

  4. #4
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: Kate/Kwrite, SSH, and permissions

    umask can only take away permissions. If the application does not specify the relevant write permission when creating, there is no way umask can force it to be turned on.

    Why do you want allow group or other write on your files? Perhaps if you explain what it is you want to do there may be a better way to get to the goal.

  5. #5

    Default Re: Kate/Kwrite, SSH, and permissions

    I read that umask only restricted permissions and noticed the difference when creating new file with vim, so I don't believe this is what I need.

    I'm working on a web project with a couple other people and we have all the files in the project set to 666 so that we can all edit them. Every time I edit a file with kate or kwrite it changes the permissions to 644. This is annoying when we're debugging javascript because I make a ton of small changes quickly. I just want existing permissions to persist on a file after saving it.

    I removed umask 000 because 644 is a good setting for file creation.

  6. #6
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: Kate/Kwrite, SSH, and permissions

    The traditional Unix permissions are not sufficient to enforce turning on particular permission bits. For this you need the POSIX ACLs. The two man pages to read are getfacl and setfacl. They are not easy to read, I'm afraid, so try to search for a tute maybe.

    Edit: here's one: http://www.cs.unc.edu/cgi-bin/howto?...nux-posix-acls

    What you need to do is set the default ACL on the top level to allow group write and this will propagate down and affect new files created underneath. Existing files may need to be have their ACL set using the recursive option of setfacl. However there are some caveats, as this post shows that files copied into this tree may not have the write permission. But if you are creating within the tree, it should work.

    Matt’s Musings POSIX/NFSv4 ACL Inheritance Problems

    BTW, Mac OS/X has something similar since BSD also conforms to POSIX ACLs.

    If you are sharing to Windows machines via Samba, you can enforce group write via Samba parameters.

  7. #7

    Default Re: Kate/Kwrite, SSH, and permissions

    How do you start kate or kwrite? From a ssh terminal session?

  8. #8

    Default Re: Kate/Kwrite, SSH, and permissions

    Kate/kwrite are running on my local. Originally I navigated to the directory with dolphin and right clicked the file -> open with -> kate or just drag the file into kate. Now all the files are saved as a session in kate.

    I looked into the ACL (it's a BSD system) and it just seems like a little bit over kill. I just want kate/kwrite to maintain the same permissions coming out that they got coming in. Notepad was running under wine but did this.

  9. #9

    Default Re: Kate/Kwrite, SSH, and permissions

    Quote Originally Posted by killsforpie View Post
    Kate/kwrite are running on my local. Originally I navigated to the directory with dolphin and right clicked the file -> open with -> kate or just drag the file into kate. Now all the files are saved as a session in kate.
    Interesting. So you're "mounting" ssh from a Unix box with fuse ... or something like that. It that case I guess it's a nontty session and your ~/.bashrc on the server side is ignored.

  10. #10

    Default Re: Kate/Kwrite, SSH, and permissions

    Quote Originally Posted by please_try_again View Post
    Interesting. So you're "mounting" ssh from a Unix box with fuse ... or something like that. It that case I guess it's a nontty session and your ~/.bashrc on the server side is ignored.
    Actually, on further investigation, I believe it sftp's the file over (it will ask me for credentials if I've been idle for awhile). I'm guessing it saves a copy locally on my machine which has the wrong permissions before sftp'ing it to the server. Maybe I can write a plugin/extension for kate that will grab the file's permissions for when the local version is created? Any clue where I could look for where the local versions might be stored?

Page 1 of 2 12 LastLast

Posting Permissions

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