Users can write data outside their directory (via SSH)

5 posts / 0 new
Last post
#1 Thu, 11/03/2011 - 16:02
Nikos

Users can write data outside their directory (via SSH)

Hallo everyone,

I know the topic of SSH and user's permissions was discussed many times, but I haven't found reason / solution for this:

1) I create new server with one user - this user has SSH access by default, into his home directory /home/user

2) If I login via SSH like this user, I can access folders like /etc /var and others - this is known "issue"

3) But what I didn't figured out, why this user can write into /etc /var and others?

The problem is, that this user can use e.g. folder /tmp like the storage no matter the limitations of his account. Or he can just mess my system everywhere :-(

Is this bug, or the classic behaviour?

Thanks for reply, best regards

Nikos

Sat, 11/05/2011 - 09:24
andreychek

Howdy,

Users can read and write to any directory they have permission to access -- and usually the default setup is secure :-) There's some details on that here:

http://www.virtualmin.com/documentation/security/faq

A user bring able to write to /tmp is normal -- that's what /tmp is there for.

A user can read some things in /etc and /var by default, but shouldn't be able to write to it. Are you sure the user is actually able to write, and not just read?

-Eric

Sat, 11/05/2011 - 13:51
Nikos

Oh, you are right. They can't write to all directories like /etc. Thanks for the link - that cleared my doubts :-).

Just last question - if I set data size limitation for virtual server - etc. 100MB - can the user write to the /tmp directory more than 100MB?

Sun, 11/06/2011 - 05:57
helpmin

he can not

Mon, 11/07/2011 - 09:03
andreychek

Howdy,

Helpmin is correct -- so long as your /tmp directory is on the same partition as /home -- your user quotas apply to both directories.

-Eric

Topic locked