linux-admin.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Users using /tmp as a storage space.
@ 2003-03-20  9:18 Mikko Grönroos
  2003-03-20  9:47 ` Andrew Kelly
  2003-03-20  9:50 ` Artem Daniliants
  0 siblings, 2 replies; 11+ messages in thread
From: Mikko Grönroos @ 2003-03-20  9:18 UTC (permalink / raw)
  To: linux-admin

Hello all,

I have a problem with users putting movies etc. to
our server's /tmp directory. How could I stop this
from happening? Any suggestions? I have tried to
gently tell them, that it's not OK, but for some
reason or another (suprise suprise) they don't care :)

Thanks,

-- 
  ___
 /__/|  Mikko.Gronroos@HUT.FI % 2476
 |__|/  HUT: Signal Processing Laboratory


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Users using /tmp as a storage space.
  2003-03-20  9:18 Users using /tmp as a storage space Mikko Grönroos
@ 2003-03-20  9:47 ` Andrew Kelly
  2003-03-20  9:59   ` Mikko Grönroos
  2003-03-20 12:25   ` Glynn Clements
  2003-03-20  9:50 ` Artem Daniliants
  1 sibling, 2 replies; 11+ messages in thread
From: Andrew Kelly @ 2003-03-20  9:47 UTC (permalink / raw)
  To: linux-admin



Mikko Grönroos wrote:
> 
> Hello all,
> 
> I have a problem with users putting movies etc. to
> our server's /tmp directory. How could I stop this
> from happening? Any suggestions? I have tried to
> gently tell them, that it's not OK, but for some
> reason or another (suprise suprise) they don't care :)
> 
> Thanks,

05  01  *   *   *   exec 'rm -rf /tmp/*'
-
To unsubscribe from this list: send the line "unsubscribe linux-admin" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Users using /tmp as a storage space.
  2003-03-20  9:18 Users using /tmp as a storage space Mikko Grönroos
  2003-03-20  9:47 ` Andrew Kelly
@ 2003-03-20  9:50 ` Artem Daniliants
  2003-03-20 10:06   ` Mikko Grönroos
  1 sibling, 1 reply; 11+ messages in thread
From: Artem Daniliants @ 2003-03-20  9:50 UTC (permalink / raw)
  To: linux-admin

 Terve.
Coz this is english maillist I'll speak english. I had the same problem
with my users (I am root in school). So here is what I did:
 1. I set quota on /home, /tmp. Soft limit = 75MB, hard limit = 100MB +   
      grace period = 7days.
 2. We bought a spare hdd for /work (about 40gigs) and put quota on it
1gig.     So now they can store them SH** in spare drive without filling
up other      hdd.
 3. In motd I put that anyone who will try something funny will get
userdel      -r.

T:greetings from Oulu


> Hello all,
>
> I have a problem with users putting movies etc. to
> our server's /tmp directory. How could I stop this
> from happening? Any suggestions? I have tried to
> gently tell them, that it's not OK, but for some
> reason or another (suprise suprise) they don't care :)
>
> Thanks,
>
> --
>   ___
>  /__/|  Mikko.Gronroos@HUT.FI % 2476
>  |__|/  HUT: Signal Processing Laboratory
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-admin"
> in the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


-- 
Artem Daniliants

E-Mail; artem@goldenrain.net
Phone:  +358504100167

FInland, Oulu



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Users using /tmp as a storage space.
  2003-03-20  9:47 ` Andrew Kelly
@ 2003-03-20  9:59   ` Mikko Grönroos
  2003-03-20 10:14     ` Andrew Kelly
  2003-03-20 12:25   ` Glynn Clements
  1 sibling, 1 reply; 11+ messages in thread
From: Mikko Grönroos @ 2003-03-20  9:59 UTC (permalink / raw)
  To: Andrew Kelly; +Cc: linux-admin

On Thu, 20 Mar 2003, Andrew Kelly wrote:

> 05  01  *   *   *   exec 'rm -rf /tmp/*'

Yeah, I thought about that, too. The solution seems
a little harsh, but I guess it's OK, if I can't make
up anything more "elegant".

Thanks a lot,

-- 
  ___
 /__/|  Mikko.Gronroos@HUT.FI % 2476
 |__|/  HUT: Signal Processing Laboratory


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Users using /tmp as a storage space.
  2003-03-20  9:50 ` Artem Daniliants
@ 2003-03-20 10:06   ` Mikko Grönroos
  0 siblings, 0 replies; 11+ messages in thread
From: Mikko Grönroos @ 2003-03-20 10:06 UTC (permalink / raw)
  To: Artem Daniliants; +Cc: linux-admin

On Thu, 20 Mar 2003, Artem Daniliants wrote:

>  Terve.

'ola!

>  1. I set quota on /home, /tmp. Soft limit = 75MB, hard limit = 100MB +
>       grace period = 7days.
>  2. We bought a spare hdd for /work (about 40gigs) and put quota on it
> 1gig.     So now they can store them SH** in spare drive without filling
> up other      hdd.
>  3. In motd I put that anyone who will try something funny will get
> userdel      -r.

Yeah, for now I've made a hack which keeps an eye on /home
and sends notification if users' home directory exceeds
a certain point. I also included a "that's just outrageous"
option to it, which automatically puts user into quota
group. But in general, I don't want to use quota, because
it seems kind of too much a cloak and dagger kind of scheme
to me.

> T:greetings from Oulu

Greets to: Future Crew, CNCD... no.. hello from Otaniemi :)

Thanks a bunch,

-- 
  ___
 /__/|  Mikko.Gronroos@HUT.FI % 2476
 |__|/  HUT: Signal Processing Laboratory


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Users using /tmp as a storage space.
  2003-03-20  9:59   ` Mikko Grönroos
@ 2003-03-20 10:14     ` Andrew Kelly
  2003-03-20 11:07       ` urgrue
  0 siblings, 1 reply; 11+ messages in thread
From: Andrew Kelly @ 2003-03-20 10:14 UTC (permalink / raw)
  To: Mikko Grönroos; +Cc: linux-admin



Mikko Grönroos wrote:
> 
> On Thu, 20 Mar 2003, Andrew Kelly wrote:
> 
> > 05  01  *   *   *   exec 'rm -rf /tmp/*'
> 
> Yeah, I thought about that, too. The solution seems
> a little harsh, but I guess it's OK, if I can't make
> up anything more "elegant".

Don't think about it as harsh, think about it as a necessary
step to take to protect the interests of your network.

For whatever reason, you need people to stop puting their
junk in /tmp. You've asked them to please stop doing that.
They still do it.

In a kind and gentle world, you might ask again (I know I
have with my users), and yes...

Sometimes you have to take it out of their hands and just
do what you have to do.

> 
> Thanks a lot,
> 

You're very welcome.

Andrew
-
To unsubscribe from this list: send the line "unsubscribe linux-admin" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Users using /tmp as a storage space.
  2003-03-20 10:14     ` Andrew Kelly
@ 2003-03-20 11:07       ` urgrue
  0 siblings, 0 replies; 11+ messages in thread
From: urgrue @ 2003-03-20 11:07 UTC (permalink / raw)
  To: linux-admin

i dont find it harsh either. if youve told them to please stop doing it 
and they havent, deleting them is completely ok behaviour in my opinion.

but, if you want to be nice about it you could make a little script 
that does something like this:

find /tmp | xargs file | egrep "AVI|MPEG|etc|etc|etc" >> evil_files_list
while read line
do
echo $line >> to_be_deleted
USER=`ls -l $line | awk '{print $3}'`
echo "Your file $line is going to be deleted in ten minutes!" | mail -s 
"Gonna getcha" $USER
done < evil_files_list
sleep 600
cat to_be_deleted | xargs rm
rm to_be_deleted
rm evil_files_list

and then run that through cron every once in a while.

(this is a real ugly script, cause im crap at scripting, but something 
along these lines should work)
in particular you might want to re-think the first line, because this 
will delete any and all mpeg/avi/etc files in /tmp. maybe you dont want 
that.
you could have it check the size, too, i guess, and only delete the big 
ones, and/or ignore files owned by certain (trusted) people, etc.

fred



> 
> 
> Mikko Grönroos wrote:
> >
> > On Thu, 20 Mar 2003, Andrew Kelly wrote:
> >
> > > 05  01  *   *   *   exec 'rm -rf /tmp/*'
> >
> > Yeah, I thought about that, too. The solution seems
> > a little harsh, but I guess it's OK, if I can't make
> > up anything more "elegant".
> 
> Don't think about it as harsh, think about it as a necessary
> step to take to protect the interests of your network.
> 
> For whatever reason, you need people to stop puting their
> junk in /tmp. You've asked them to please stop doing that.
> They still do it.
> 
> In a kind and gentle world, you might ask again (I know I
> have with my users), and yes...
> 
> Sometimes you have to take it out of their hands and just
> do what you have to do.
> 
> >
> > Thanks a lot,
> >
> 
> You're very welcome.
> 
> Andrew
> -
> To unsubscribe from this list: send the line "unsubscribe linux-admin"
> in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
-
To unsubscribe from this list: send the line "unsubscribe linux-admin" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Users using /tmp as a storage space.
  2003-03-20  9:47 ` Andrew Kelly
  2003-03-20  9:59   ` Mikko Grönroos
@ 2003-03-20 12:25   ` Glynn Clements
  2003-03-20 14:14     ` Brian Harring
  1 sibling, 1 reply; 11+ messages in thread
From: Glynn Clements @ 2003-03-20 12:25 UTC (permalink / raw)
  To: linux-admin


Andrew Kelly wrote:

> > I have a problem with users putting movies etc. to
> > our server's /tmp directory. How could I stop this
> > from happening? Any suggestions? I have tried to
> > gently tell them, that it's not OK, but for some
> > reason or another (suprise suprise) they don't care :)
> 
> 05  01  *   *   *   exec 'rm -rf /tmp/*'

That's a bit too "brute force", and could interfere with normal
operation. It would better to only delete files that are more than X
hours old.

Also, you have to be very careful when performing directory traversals
on world-writable directories such as /tmp. Unless the program has
been explicitly hardened against such attacks, a malicious user could
cause arbitrary files to be deleted. Ideally, use a dedicated "/tmp
cleaner" program.

-- 
Glynn Clements <glynn.clements@virgin.net>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: Users using /tmp as a storage space.
@ 2003-03-20 12:50 Bruce Harvey
  0 siblings, 0 replies; 11+ messages in thread
From: Bruce Harvey @ 2003-03-20 12:50 UTC (permalink / raw)
  To: linux-admin

Sounds like time to get "management" to agree to the rules ... or to make
them up.  If none exist whatsoever, you probably need to come up with a
'fair use' rule for the system, whereby everyone gets to know what's "legal"
and what isn't and what the consequences are and get "management" to buy
into it.  If it turns out that "management" is OK with what they're doing
... learn to love it and increase the space allocated to /tmp immensely.
Otherwise, you should get the backing you deserve.

Certainly don't come at them with an "I'm gonna get you 'cause I told you
not to" and so on.  If you get the backing, just let them know that because
their extraneous files threaten the proper workings of the system, they both
can't be guaranteed of having their files there and might get in trouble
because of it ... no hard feelings.

Good luck!

 
----------------------------------
Bruce T. Harvey (Special Projects)
----------------------------------------
bth@comcast.net  -- bruceh@routescape.com
410-236-5721 (cell) -- 410-403-2390 (off.)
-------------------------------------------
Insight Distribution Systems / CoAxis, Inc.
Hunt Valley, Maryland  U.S.A.  21031-1422
-------------------------------------------



-----Original Message-----
From: Glynn Clements [mailto:glynn.clements@virgin.net]
Sent: Thursday, March 20, 2003 7:26 AM
To: linux-admin@vger.kernel.org
Subject: Re: Users using /tmp as a storage space.



Andrew Kelly wrote:

> > I have a problem with users putting movies etc. to
> > our server's /tmp directory. How could I stop this
> > from happening? Any suggestions? I have tried to
> > gently tell them, that it's not OK, but for some
> > reason or another (suprise suprise) they don't care :)
> 
> 05  01  *   *   *   exec 'rm -rf /tmp/*'

That's a bit too "brute force", and could interfere with normal
operation. It would better to only delete files that are more than X
hours old.

Also, you have to be very careful when performing directory traversals
on world-writable directories such as /tmp. Unless the program has
been explicitly hardened against such attacks, a malicious user could
cause arbitrary files to be deleted. Ideally, use a dedicated "/tmp
cleaner" program.

-- 
Glynn Clements <glynn.clements@virgin.net>
-
To unsubscribe from this list: send the line "unsubscribe linux-admin" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Users using /tmp as a storage space.
  2003-03-20 12:25   ` Glynn Clements
@ 2003-03-20 14:14     ` Brian Harring
  2003-03-21  1:42       ` Mikhail Romanenko
  0 siblings, 1 reply; 11+ messages in thread
From: Brian Harring @ 2003-03-20 14:14 UTC (permalink / raw)
  To: linux-admin

Andrew Kelly wrote:
>  > 05  01  *   *   *   exec 'rm -rf /tmp/*'
>
>That's a bit too "brute force", and could interfere with normal
>operation. It would better to only delete files that are more than X
>hours old.

Speaking from experience, I don't think that's too good of a way of 
doing it either- I know x-windows and kde both use unix sockets that 
are stored in /tmp.  If you brute force delete them, you're going to 
cause problems for any x-windows session that is currently going.
Also, if I recall correctly, mysql stores it's unix socket there too- 
deletion of that would/should cause problems for programs that access 
mysql locally.

You could quite easily wipe the /tmp dir at bootup, but that may not 
be the best solution for you mainly due to its reliance on reboot's 
to cleanse the dir.  Why not just write a simple bash/perl script 
that does some basic tests on the file in /tmp before deletion?

Via perl at least, you could quite easily write a simple script that 
deletes files that are over a certain size, or a bit more brutal 
method in my books, everything in /tmp that isn't a program's socket 
file.
~Brian

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Users using /tmp as a storage space.
  2003-03-20 14:14     ` Brian Harring
@ 2003-03-21  1:42       ` Mikhail Romanenko
  0 siblings, 0 replies; 11+ messages in thread
From: Mikhail Romanenko @ 2003-03-21  1:42 UTC (permalink / raw)
  To: linux-admin


----- Original Message -----
From: Brian Harring <bdharring@wisc.edu>
To: <linux-admin@vger.kernel.org>
Sent: Thursday, March 20, 2003 7:14 PM
Subject: Re: Users using /tmp as a storage space.


> Andrew Kelly wrote:
> >  > 05  01  *   *   *   exec 'rm -rf /tmp/*'
> >
> >That's a bit too "brute force", and could interfere with normal
> >operation. It would better to only delete files that are more than X
> >hours old.
>
> Speaking from experience, I don't think that's too good of a way of
> doing it either- I know x-windows and kde both use unix sockets that
> are stored in /tmp.  If you brute force delete them, you're going to
> cause problems for any x-windows session that is currently going.
> Also, if I recall correctly, mysql stores it's unix socket there too-
> deletion of that would/should cause problems for programs that access
> mysql locally.

From my experience common users mostly use Windows on thir client computers
and access linux server via samba. I use /bin/false as default shell while
creating
a new user. In such cases I use /var/local/tmp as \\<servername>\tmp samba
resource
and disable /tmp in smb.conf which is enabled by default. Keeping in mind
that
only samba users use /var/local/tmp no "brute force" could interfere with
normal
operation.
What about users who have /bin/sh as a shell they are experienced enough to
understand explanation how they should (and should not) use /tmp. In my case
from about 150 users only two (me, as system administrator, and one more
guy),
and system pseudousers have /bin/bash as a shell.

Mikhail.



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2003-03-21  1:42 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-20  9:18 Users using /tmp as a storage space Mikko Grönroos
2003-03-20  9:47 ` Andrew Kelly
2003-03-20  9:59   ` Mikko Grönroos
2003-03-20 10:14     ` Andrew Kelly
2003-03-20 11:07       ` urgrue
2003-03-20 12:25   ` Glynn Clements
2003-03-20 14:14     ` Brian Harring
2003-03-21  1:42       ` Mikhail Romanenko
2003-03-20  9:50 ` Artem Daniliants
2003-03-20 10:06   ` Mikko Grönroos
  -- strict thread matches above, loose matches on Subject: below --
2003-03-20 12:50 Bruce Harvey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).