Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Sep 2004 03:35:04 +0200
From:      Alex de Kruijff <freebsd@akruijff.dds.nl>
To:        Andrew <infofarmer@mail.ru>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Ultimately Safe User Account
Message-ID:  <20040924013504.GD784@alex.lan>
In-Reply-To: <001101c4a1a3$bb731880$460011ac@SATPC>
References:  <001101c4a1a3$bb731880$460011ac@SATPC>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi Andrey,

On Thu, Sep 23, 2004 at 11:30:06PM +0400, Andrew wrote:
> Hi,
> 
> I have a production FreeBSD box. My friend is starting to learn Unix
> essentials and is asking me for an account. He doesn't require any
> special rights, but he certainly wants to be able to use shell and read
> most manual pages. He'll access the server via Internet, SSH.

Don't add him to the group wheel. If you paranoid then you can use one
time passwords. (I only use this for persons with in the group wheel,
and then only for non-ssh.)

> How can I create an account, so that it is completely safe to let him
> in? How can I jail/chroot him and do I need to do it this way? I want to
> limit everything: disk space (~500Mb), RAM (~10%), processes (~30), cpu
> (~5-10%), _internet connectivity_ (bandwidth is expensive and he must
> not be able to download much). He is new to Unix but I have to suppose
> that somebody very experienced can steal his account info.

I don't think you need to use jail/chroot. You can limit the use of HD,
RAM and CPU with quota's
1. http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/quotas.html
2.  http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/firewalls.html

And limit bandwith with ipfw & dummynet. 
1. http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/firewalls.html
2. http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/firewalls.html
3. man ipfw

Set your firewall so that it allows everthing out and nothing in exept
ssh or http.

If you like to have this so that he can use 100% for a short time and
something like 20% then you can do this with a combination of ipfw &
dummynet & ipa (a port). I have tree half finished article about this.
The above is handy to read before these.


> I'd be glad if he had only very basic ls, cp, mv, as well as sh and vi.
> I don't want him to have any browser or fetch-like utility.

This be done with jail/chroot.

> I know that letting somebody log in is already a security hole, but I
> want to minimize the risks.

-- 
Alex

Articles based on solutions that I use:
http://www.kruijff.org/alex/FreeBSD/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040924013504.GD784>