Re: File Permissions not working in chroot environment? (SSH2 on Linux)

From: all mail refused (elvis@notatla.demon.co.uk)
Date: 03/27/03

  • Next message: Richard E. Silverman: "Re: Problem with SSH on Solaris 9"
    From: elvis@notatla.demon.co.uk (all mail refused)
    Date: Thu, 27 Mar 2003 21:56:08 +0000 (UTC)
    
    

    In article <b5vk0i$1mb$00$1@news.t-online.com>, Merten Schueler wrote:
    >Hi,
    >
    >I have just installed the non-commercial version SSH2 (3.2.0) on my SuSE
    >Linux 8.0 Machine. I have set up a chrooted environent to allow users to
    >do SFTP transfers to their home dirs, using the ssh-dummy-shell.
    >
    >Everything works fine, except one problem: File permissions seem to have
    >no effect. If I create a file as root with permissions set to 600 in the
    >users home dir, that user may delete it via the SFTP Client.
    >
    >What am I doing wrong, is there a way to prevent this?

    The ability to delete a file comes from the write permission on the directory
    holding it - nothing to do with the file's own owner and mode. If these users
    are not supposed to have interactive logins perhaps root should be the owner
    of their home directories.

    If you feel like something more exotic you could patch the kernel to have
    different behaviour (such as ban sys_unlink()) if the current process's
    root is not the root of init.

    -- 
    decoy mail addresses: obtain username via 0x4f/tcp or 0x50/tcp
    I don't use: mpeti_ka15@rediffmail.com sales@licaplast.com
                 stopmail100@emailacc.com  sir_nat_the_brat@hotmail.com
    

  • Next message: Richard E. Silverman: "Re: Problem with SSH on Solaris 9"

    Relevant Pages

    • Change Permissions on a new hard drive to allow write...Problem Solved
      ... Then I right clicked on the drive, selected "Properties" then "Permissions" and simply checked the boxes for "write" for Owner, Group, and Others. ... I really don't understand why so many people think that logging in as root when needed is such a bad thing, although I can certainly see a better way to accomplish what I needed to do. ... See my other post "Vote for new Ubuntu Feature---Let's try it again". ...
      (Ubuntu)
    • Re: Migrating from Windows to Debian - keeping email messages from Outlook Express
      ... As I was operating as root when copying the backed data from the ... > all that data is root, the group is also root and the permissions are ... I need to change the owner of all these files (and ... # chown -R user:group /dir ...
      (Debian-User)
    • Re: [RFC] FUSE permission modell (Was: fuse review bits)
      ... >> root is denied all access. ... and the kernel checks the permission. ... The userspace can't enforce the permissions. ...
      (Linux-Kernel)
    • Re: Migrating from Windows to Debian - keeping email messages from Outlook Express
      ... As I was operating as root when copying the backed data from the ... the group is also root and the permissions are ... I need to change the owner of all these files (and ... started just for the purpose of this (Subject: Setting permissions, ...
      (Debian-User)
    • Re: Adding a hard disk
      ... > I changed the owner of /home/backup to kip and the group to nogroup. ... > When I rebooted, the /home/backup was owned by root, the group was root, ... > and the permissions were drwxr-xr-x and the file in the directory was ...
      (Ubuntu)