Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: Customizing User Folders with /etc/skel ?

  1. #11
    Join Date
    Mar 2010
    Location
    Freedom 3
    Beans
    379
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Customizing User Folders with /etc/skel ?

    Quote Originally Posted by johnh10000 View Post
    This seems similar to what I want to do. I have a small user base (4) at the moment!
    In /etc/skel/ I have added Public /Public/ftp /Public/incomming

    What I'd like is to is this, for existing users and users I may add in the future.

    I run an sftp/ftp server, in these I have incomming (I know its spelt wrong)
    in which there are folders jono johnh etc

    I need incomming "mounted" in home/$user/Public/incomming and only $user incomming folder write-able by the owner.

    At present I manually write the xtra bits to fstab.
    Code:
    /home/incomming /home/ftp/incomming none rw,bind 0 0
    /home/ftp /home/jono/Public/ftp none rw,bind 0 0
    /home/incomming /home/jono/Public/incomming none rw,bind 0 0
    /home/incomming /home/johnh/incomming none rw,bind 0 0
    /home/ftp/ /home/johnh/ftp none rw,bind 0 0
    /home/incomming /home/jackief/incomming none rw,bind 0 0
    /home/ftp/ /home/jackief/ftp none rw,bind 0 0
    /home/ftp/ /home/annon none rw,bind 0 0
    /home/ftp /home/jeffw/documents/ftp none rw,bind 0 0
    /home/incomming /home/jeffw/documents/incomming none rw,bind 0 0
    any clues as to how to automate this?
    I haven't set up an ftp server yet, so I don't know whether there are specific needs regarding how you set permissions to directories underneath the ftp server's tree. If there aren't any, then simply setting permissions as needed for your users' directories inside /home/incomming/ and putting something like the following inside the /etc/skel/.bashrc

    Code:
    if [ ! -e ${HOME}/Public/ftp ] ; then
        ln -s /home/ftp/ ${HOME}/Public/ftp
    fi
    if [ ! -e ${HOME}/Public/incomming ] ; then
        ln -s /home/incomming/${USER} ${HOME}/Public/incomming
    fi
    would do the trick. You still need a way to make the folders inside /home/incomming, but this can be wrapped around the `adduser' command (for example by creating a wrapper script that first makes the folders, then adds the user) so that they can be executed as part of the account creation process.
    To suppress free speech is a double wrong. It violates the rights of the hearer as well as those of the speaker.
    Free Software - Free Society | The GNU Project | FSF | ESP

  2. #12
    Join Date
    Apr 2005
    Location
    Honolulu, HI
    Beans
    22
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Customizing User Folders with /etc/skel ?

    Quote Originally Posted by gzarkadas View Post
    There is no need for a setuid script, not even for changing /etc/sudoers (which is indeed a better approach); /mnt/data permissions can simply be set as drxwrwxrwt (ie set the sticky bit)
    Ah, yesh, yesh, the sticky bit. You're right: much less fuss that way.

    I rescind my previous remarks about sudo and the "NOPASSWD:" option. Though I do hope that post was at least educational for someone.

Page 2 of 2 FirstFirst 12

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
  •