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

Thread: Can I prevent users from filling up the /tmp-folder?

  1. #1
    Join Date
    Jun 2012
    Location
    Sweden
    Beans
    324
    Distro
    Ubuntu 12.04 Precise Pangolin

    Can I prevent users from filling up the /tmp-folder?

    A normal user has read and write access to the /tmp-folder. If someone decides to "block" other users from using the system, the person can just fill up the /tmp-folder until it's full (with echo /dev/null>/tmp/bigfile or something like that), so no other user can write data to it (simply because it's full). Can I limit how much size, as maximum, of a certain mounting point (in this case /tmp) a user can use? Do I need to have /tmp on its own partition? It is possible to limit all files in the ~ (a user's home folder) to a maximum at, let's say 0.5 GiB, excluded the .thunderbird-folder (in other words, the content in the .thunderbird-folder will not included in the limit at 0.5 GiB)?

  2. #2
    Join Date
    Jun 2009
    Location
    0:0:0:0:0:0:0:1
    Beans
    5,169
    Distro
    Kubuntu

    Re: Can I prevent users from filling up the /tmp-folder?

    if a user is filling up /tmp/ intentionally they would just be able to do it in the sub folder .thunderbird-folder (why is that in /tmp anyway?)
    you can move /tmp to another drive/partition/ram easily using fstab, but if that filled up there would still be issues
    not sure of a way to limit there data in /tmp
    Laptop: ASUS A54C-NB91 (Storage: WD3200BEKT + MKNSSDCR60GB-DX); Desktop: Custom Build - Images included; rPi Server
    Putting your Networked Printer's scanner software to shame PHP Scanner Server
    I frequently edit my post when I have the last post

  3. #3
    Join Date
    May 2010
    Location
    uk
    Beans
    9,249
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: Can I prevent users from filling up the /tmp-folder?

    Hi

    Mount /tmp on its own partition and use per user disk quotas ?

    http://www.yolinux.com/TUTORIALS/Lin...ialQuotas.html

    I believe that's quite standard practice.

    Kind regards
    Last edited by matt_symes; March 2nd, 2013 at 03:40 AM.
    If you believe everything you read, you better not read. ~ Japanese Proverb

    If you don't read the newspaper, you're uninformed. If you read the newspaper, you're mis-informed. - Mark Twain

    Thinking about becoming an Ubuntu Member?

  4. #4
    Join Date
    Dec 2009
    Location
    germany
    Beans
    1,020
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Can I prevent users from filling up the /tmp-folder?

    hi
    ok that's a solution for that "little" problem. but i think there are much bigger problems.
    just run: ulimit -a
    i know you now wath i mean.
    i predict this my customer since years. you have to occupy a system (talking about servers) to now what is the normal behavior. oh yeah this is expansive (it only looks like ).
    have a nice day
    ciao
    "What is the robbing of a bank compared to the FOUNDING of a bank?" Berthold Brecht

  5. #5
    Join Date
    Jun 2012
    Location
    Sweden
    Beans
    324
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Can I prevent users from filling up the /tmp-folder?

    Quote Originally Posted by pqwoerituytrueiwoq View Post
    if a user is filling up /tmp/ intentionally they would just be able to do it in the sub folder .thunderbird-folder (why is that in /tmp anyway?)
    you can move /tmp to another drive/partition/ram easily using fstab, but if that filled up there would still be issues
    not sure of a way to limit there data in /tmp
    No. The .thunderbird-folder is in the ~-folder (/home/.../.thunderbird). I want to limit the usage of /tmp and /home (but not ~/.thunderbird).

  6. #6
    Join Date
    Dec 2009
    Location
    germany
    Beans
    1,020
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Can I prevent users from filling up the /tmp-folder?

    hi bufeu
    matt_syms allready gave you the correct answer - use quotas.
    cheers
    "What is the robbing of a bank compared to the FOUNDING of a bank?" Berthold Brecht

  7. #7
    Join Date
    Jun 2012
    Location
    Sweden
    Beans
    324
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Can I prevent users from filling up the /tmp-folder?

    Quote Originally Posted by rnerwein View Post
    hi bufeu
    matt_syms allready gave you the correct answer - use quotas.
    cheers
    Yes, I saw it. That means I can only enable a limit on a whole partition, not only a directory?

  8. #8
    Join Date
    May 2010
    Location
    uk
    Beans
    9,249
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: Can I prevent users from filling up the /tmp-folder?

    Hi

    I would be mounting /tmp on its own partition anyway, in a multi-user environment.

    As far as i'm aware, quotas are based on filesystems and not directories. (at least in ExtX filesystems)

    I am open to correction though.

    Kind regards
    If you believe everything you read, you better not read. ~ Japanese Proverb

    If you don't read the newspaper, you're uninformed. If you read the newspaper, you're mis-informed. - Mark Twain

    Thinking about becoming an Ubuntu Member?

  9. #9
    Join Date
    Feb 2013
    Beans
    Hidden!

    Re: Can I prevent users from filling up the /tmp-folder?

    Well, I guess it's possible to exclude ~/.thunderbird from quota, but you will have to maintain a symlink farm for this.
    That is, you will have so to say two /home hierarchies: one for user home directories as usual, another, on a separate filesystem, for their .thunderbird subdirs. The disk quota is then turned on only on /home.

    If you don't use NFS for automounting user home directories then it'll be enough to put into /usr/local/sbin/adduser.local something like
    Code:
    mkdir /.thunderbird/$1
    chown $1: /.thunderbird/$1
    ln -s /.thunderbird/$1 $4/.thunderbird
    for corresponding /.thunderbird/username directory to be created and symlinked automatically when adding new users.

    See adduser(8) for description of the /usr/local/sbin/adduser.local script and its parameters.

  10. #10
    Join Date
    Dec 2009
    Location
    germany
    Beans
    1,020
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Can I prevent users from filling up the /tmp-folder?

    hi
    i would say you can set it per user inside of a filesystem.
    i am open too for correction
    ciao
    "What is the robbing of a bank compared to the FOUNDING of a bank?" Berthold Brecht

Page 1 of 2 12 LastLast

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
  •